script to delete and replace files

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

 



i´m writing a script to backup some files, the idea is to backup the file 
adding the date. I will copy the file tgz to another folder. This is a daily 
backup and it is so large. So I need the new one file tgz replace the oldest 
in the folder comparing the date how to do that?

i did something like that :

fecha=`date +"%y%m%d"`

1)
time tar -czvf /var/BACKUP/ftpuser.$fecha.tgz /home/ftpuser so the result is 
ftpuser060905.tgz (size 30gb) so next day I need the new file tgz 
ftpuser070905.tgz replaces the previous one i mean, delete the previous one 
and put the new one. How to do that?, sorry i'm not good at programing


thanks

Ignacio Gómez
Bogotá Colombia
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subjecthttps://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux