[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

non-interactive ftp


i'm trying to write a backup script which is directly saving the
valueable data to my ftp-backup space. i was going to use ncftpput, because it lets me do this:

tar cvf - /home | ncftpput -u operator -c server /backups/monday.tar

so i can backup direct to my backup space without saving it to the local disk (which is a good thing, as content grows...). but this way i also have to rotate the backups on the backup space. only ftp is allowed on the backup server and ncftp* does not allow me to send non-RAW ftp command (or i'm too dumb to parse the manpages). so, tried to use good ol' ftp(1) with the help of .netrc:

macdef rotate-daily
        cd /backup/daily.2
        mdelete *
        cd /backup
        rename daily.1 daily.2
        rename daily.0 daily.1
        mkdir daily.0

(this way i have the today and the last 2 days of backup....)

but: now i have to use ncftpput to do this "tar | ncftpput" thing *and* .netrc to rotate the backups. i want to use only one of them and i wonder if i can stretch ftp(1) even further to do something like ncftpput above.

i already found some interesting examples of piping from/to .tar files with an ongoing ftp session:


but i fail to do the connect, the put, the call of the .netrc macro all in one step. if anybody has some suggestions here....

thank you,
BOFH excuse #127:

Sticky bits on disk.

Reply to: