Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleaning of old files via ftp #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akupchanko
Copy link

We don't need to join the path to filename, received by ftp.nlst(path), because we get full path from ftp
And, as example, instead of removing mysqldump/postfixadmin/mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1443.sql.gz we should remove mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1443.sql.gz

Uploading FTP_SERVER:mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1445.sql.gz via FTP
Sending /var/astrails-safe/mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1445.sql.gz to mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1445.sql.gz
...done
listing files: FTP_SERVER:mysqldump/postfixadmin/mysqldump-postfixadmin.*
mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1443.sql.gz
mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1445.sql.gz
mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1444.sql.gz
removing ftp file FTP_SERVER:mysqldump/postfixadmin/mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1443.sql.gz
/usr/lib/ruby/1.9.1/net/ftp.rb:300:in `getresp': 550 mysqldump/postfixadmin/mysqldump/postfixadmin/mysqldump-postfixadmin.131026-1443.sql.gz: No such file or directory (Net::FTPPermError)
    from /usr/lib/ruby/1.9.1/net/ftp.rb:325:in `block in sendcmd'
    from /usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    from /usr/lib/ruby/1.9.1/net/ftp.rb:323:in `sendcmd'
    from /usr/lib/ruby/1.9.1/net/ftp.rb:746:in `delete'
........

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant