script to delete and replace files

Greg Golin greg.golin at gmail.com
Wed Sep 7 02:55:26 UTC 2005


Ignacio,

This is probably not the way you want to do backups. Removing and
writing 30Gb daily is hardly a good practice from any standpoint,
especially. I am sure your ftpuser directory doesnt get changed a
whole lot over night. So there is little sense in deleting/writing
essentially the same data nightly.

I suggest that you:
1. Take the time to sit down and read a little on backup strategies. 
2. Take a look at rsync. This is probably the best solution for your
situation. [Which is quite common, might I add.]

Kind Regards,
Greg

On 9/7/05, Ignacio Gómez <igomezu at gmail.com> wrote:
> 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 at redhat.com?subjectunsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>




More information about the redhat-list mailing list