Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

how to copy directory to a tftp server ?

Hi all

This may sound basic but can anyone tell me how to copy a directory from my flash to a tftp server ?

cheers

Carl

1 ACCEPTED SOLUTION

Accepted Solutions

how to copy directory to a tftp server ?

Hi,

One way of doing this would be by the use of the archive command with the /create option to make a TAR file that is copied to the TFTP server.

Here's an example where I have a directory (called directory) with a number of files. I create an archive of this directory and send that directly to my TFTP server called redhat1.

ocs7206-2#cd disk0:

ocs7206-2#dir

Directory of disk0:/

    1  -rw-       15617  Jul 22 2008 17:03:00 +01:00  ocs7206-2-124-13c-config

    3  -rw-     1161737   Oct 4 2011 14:33:36 +01:00  cpu_mon

    6  drw-           0  Mar 24 2013 08:11:26 +00:00  directory

47890432 bytes total (46645248 bytes free)

ocs7206-2#dir directory

Directory of disk0:/directory/

    7  -rw-       18899  Mar 24 2013 08:12:42 +00:00  file1.txt

    8  -rw-       18899  Mar 24 2013 08:12:48 +00:00  file2.txt

    9  -rw-       18899  Mar 24 2013 08:12:52 +00:00  file3.txt

47890432 bytes total (46645248 bytes free)

ocs7206-2#archive tar /create tftp://redhat1/directory.tar disk0:/directory

!!

archiving file1.txt (18899 bytes)

archiving file2.txt (18899 bytes)

archiving file3.txt (18899 bytes)

And on my TFTP server I can see the tar file and it's contents:

[sfuller@redhat1 tftpboot]$ ls -l directory.tar

-rw-r--r-- 1 sfuller sfuller 58368 2013-03-24 08:21 directory.tar

[sfuller@redhat1 tftpboot]$ tar tvf directory.tar

-rw-r--r-- 0/0           18899 2013-03-24 08:12:42 file1.txt

-rw-r--r-- 0/0           18899 2013-03-24 08:12:48 file2.txt

-rw-r--r-- 0/0           18899 2013-03-24 08:12:52 file3.txt

Hopefully the above, or some slight variation, will do exactly what you need.

Regards

3 REPLIES

Re: how to copy directory to a tftp server ?

Hi
I m not u can copy a dirctory but u can copy a file from flash line below
Copy flash:filename tftp
After this u will be primpted for tftp ip address

Sent from Cisco Technical Support iPhone App

New Member

You can copy TAR IOS file to

You can copy TAR IOS file to TFTP. 

You can use tftpd32 v3.3 and set some parameters so file can be copied .

tftpd32 - > Settings -> TFTP Configurations
timeout (seconds) - 1200
Max Transmite - 100000


Fire command on Switch (privileged EXEC mode)
Switch(2960-X)#
Switch(2960-X)#archive upload-sw tftp://tftp -server-ipaddress/ios file name

Switch(2960-X)#archive upload-sw tftp://172.20.100.100/c2960x-universalk9-mz.150-2.EX5


Thanks
Hitendra Suthar

how to copy directory to a tftp server ?

Hi,

One way of doing this would be by the use of the archive command with the /create option to make a TAR file that is copied to the TFTP server.

Here's an example where I have a directory (called directory) with a number of files. I create an archive of this directory and send that directly to my TFTP server called redhat1.

ocs7206-2#cd disk0:

ocs7206-2#dir

Directory of disk0:/

    1  -rw-       15617  Jul 22 2008 17:03:00 +01:00  ocs7206-2-124-13c-config

    3  -rw-     1161737   Oct 4 2011 14:33:36 +01:00  cpu_mon

    6  drw-           0  Mar 24 2013 08:11:26 +00:00  directory

47890432 bytes total (46645248 bytes free)

ocs7206-2#dir directory

Directory of disk0:/directory/

    7  -rw-       18899  Mar 24 2013 08:12:42 +00:00  file1.txt

    8  -rw-       18899  Mar 24 2013 08:12:48 +00:00  file2.txt

    9  -rw-       18899  Mar 24 2013 08:12:52 +00:00  file3.txt

47890432 bytes total (46645248 bytes free)

ocs7206-2#archive tar /create tftp://redhat1/directory.tar disk0:/directory

!!

archiving file1.txt (18899 bytes)

archiving file2.txt (18899 bytes)

archiving file3.txt (18899 bytes)

And on my TFTP server I can see the tar file and it's contents:

[sfuller@redhat1 tftpboot]$ ls -l directory.tar

-rw-r--r-- 1 sfuller sfuller 58368 2013-03-24 08:21 directory.tar

[sfuller@redhat1 tftpboot]$ tar tvf directory.tar

-rw-r--r-- 0/0           18899 2013-03-24 08:12:42 file1.txt

-rw-r--r-- 0/0           18899 2013-03-24 08:12:48 file2.txt

-rw-r--r-- 0/0           18899 2013-03-24 08:12:52 file3.txt

Hopefully the above, or some slight variation, will do exactly what you need.

Regards

19584
Views
14
Helpful
3
Replies