- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2010 04:46 AM
Hi,
I am trying to copy multiple files from flash to a FTP server. Is it possible to copy multiple files using one statement? For example:
First i type
dir flash: | i file
166 -rw- 73986 Oct 7 2010 12:25:36 +03:00 file1.817
167 -rw- 73265 Oct 7 2010 13:26:08 +03:00 file2.861
168 -rw- 204278 Oct 8 2010 13:38:06 +03:00 file3.950
And i need to copy all file begin with name "file" to ftp or tftp server.
copy flash:/file1.817 ftp://username:passwd@10.10.10.1/
copy flash:/file2.861 ftp://username:passwd@10.10.10.1/
copy flash:/file3.950 ftp://username:passwd@10.10.10.1/
Is this possible to do this with EEM or TCL script automatically
Can you give me some examples?
Thanks in advanced
Solved! Go to Solution.
- Labels:
-
Network Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2012 12:48 PM
The way the code was written, if the FTP server is down, the delete path should never be encountered. Now if the server is taken down after the check is done, then the actual FTP may fail with an unexepected error, and thus the files will be deleted. I can't tell what is happening based on this log, though. I don't see the files getting deleted when the server is down.
What error do you see when you initiate the FTP transfer when the server is down?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2012 12:59 PM
So sorry my english is no so good, Those are the error messagges that I get when my server is down by line command (/etc/init.d/vsftp stop), I do not need make a backup of the running, this was the reason because I disable this part of the script at first time.
R3#copy running-config ftp://192.168.99.253/cdr/pruebalts.txt
Address or name of remote host [192.168.99.253]?
Destination filename [cdr/pruebalts.txt]?
Writing cdr/pruebalts.txt
%Error writing ftp://192.168.99.253/cdr/pruebalts.txt (Undefined error)
R3#telnet 192.168.99.253 21
Trying 192.168.99.253, 21 ...
% Connection refused by remote host
R3#
Regards and I really apreciate your effort.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2012 08:22 AM
This error is accounted for in my original code. I don't know why the files would be deleted in that case. Again, your previous log didn't show any problem that I could see. The files only got deleted when they were transferred. If you've modified my script, maybe the modifications are causing a problem. Post the actual script you're using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 04:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2012 05:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2012 06:04 AM
Thanks a lot Josep, I am going to test this new file, just a short question about this new script, what is the difference on this script with my script.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2015 05:39 AM
http://www.cisco.com/c/en/us/td/docs/ios/fundamentals/command/reference/cf_book/cf_a1.html#wp1047206
The following example shows how to create a TAR file. The command writes the contents of the new-configs directory on the local flash device to a file named saved.tar on the TFTP server at 172.20.136.9.
Switch# archive tar /create tftp:172.20.136.9/saved.tar flash:/new-configs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2015 12:41 AM
I think you should add this line to prevent overwriting files on FTP server with unclosed ones from previous script start:
puts "FTP SERVER $ftpServer IS OPEN"
set fileList [glob -directory flash: -nocomplain "cdr/cdr.*"]
+ cli_write $cli1(fd) "file-acct flush with-close"
foreach file $fileList {

- « Previous
-
- 1
- 2
- Next »