Navigation
Popular content
Today's:Active forum topics
Recent comments
|
Batch file to delete old files from FTP serverHello everyone! :) I would like to find a batch file that could be ran by Task Scheduler twice a day to delete the older files from the FTP server, allowing recent images to be accepted. I figure this can be done by timestamp of the images, or even file count, but my experience with writing custom batch files is non-existent. I have been googling it for a few days now but my lack of understanding where to put what info to make it work is holding me back. None that I have found include obvious examples of the relavent information, like a name for the FTP server (example.ftp.com) or username/passwd (user/passwd). They just say something like "you have to put your information in the script," or "here you point to your FTP server" leaving me stumped. If anyone could guide me along to get this working I would greatly appreciate it! Thanks in advance. |
User login
Donations If this web site has helped you, please help us too! Recent blog posts
Windows news ticker
Who's new
Who's online
There are currently 0 users and 5 guests online.
hits since 2010-03-12 · Statistics |
Windows ftp
Fri, 2008-11-28 23:14 by admin
If you use the Windows ftp command, the simplest method to keep a small number of older backup files is to let ftp execute several rename commands like this:
You can put these commands plus the logon and logoff information into a script file and start it with the command:
This assumes that your script file is named: script.ftp
It also assumes that this same script sends the latest image to the ftp server.
Another way is to get a local file listing of the remote ftp folder with the ftp command:
Or use some similar ftp command. Then transform the filelist file into the desired ftp command chain, using a local script program. This would be more demanding, but I see no simpler way to do exactly what you want, and I have no ready-made, complete solution. I only know that it is possible, relatively easy for a programmer, but still requires some work, perhaps a few hours for finding out the right commands, programming, and testing.