Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

howto delete old backup files via ftp using cron job ? 1

Status
Not open for further replies.

anonimous

IS-IT--Management
Sep 22, 2003
31
CH
hi

I use this command from cron job

30 3 * * * root tar Pcj /usr/local/httpd | ncftpput -c -u <your_username_on_remote_host> -p <your_pass_on_remote_host> <remote_host> <directory_on_remote_host>/save-`date +%Y.%m.%d-%H%M`.tar.bz2

to save daily via ftp the whole Web server data

it's working well. but now I have
200 backup files !

how to use this and delete at the same time all old ones backup files ?

regards
anonimous
 
If you only want to keep one backup file, then remove the date stamp on the filename.

Matt J.
 
but I need files with exact date.

regards
anonimous
 
use a wildcard delete on all your old files as the first command in your backup script.
 
and how it works exactly with wildcard ?
I've never used before.

kind regards
anonimous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top