KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
There is a problem - need to store the database backup on the FTP. On the FTP should not be more than 10 back-ups, ie, After you add backup to FTP should be removed, the oldest files to make the total number of files can not exceed 10 pieces. How can we implement such a removal from the ftp? I'm trying to write a script, but does not work delete: x=1 ftp -vn $FTP_SERVER<<! user $FTP_LOGIN $FTP_PASSWORD binary put $DUMP_FILE_NAME for i in `ls -t` do if [ $x -le $keep ] then ((x++)) continue fi delete $i done bye EOF </i>
Tags (comma-separated)
Save Edits
Cancel