> >         #!/bin/bash
> >          tar cvzf  /shared/backup /home/someuser

Or perhaps something like this:

#!/bin/bash

# First move old backups to deletable backups

for x in $( ls /shared/ |grep gz.old ); do
mv /shared/$x /shared/$x.deleteme;
done

# Now move current backups to old backups

for y in $( ls /shared/ |grep backup ); do
mv /shared/$y /shared/$y.old;
done

# Now create new backups from the /home dir

for z in $( ls /home/ ); do
tar cvfz /shared/$z.backup.tar.gz /home/$z;
done


Not the best script in the world, but for 30 seconds worth of work, it is
usable.  This example has some bugs in it, (i.e. on the third pass, after
the .old files are renamed .old.deletme, the second loop reneames them
again to .old.deleteme.old due to a bad choice in grep arguenemts and
naming conventions)

anyway, you can use something like that, then set up a cron job to delete
the deleteme files after two weeks, (assuming you are doing only weekly
backups).

cheers



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to