Hi,
I have created a smal script in an RHEL 5.2 that finds files older than 30 days and then TARs them and deletes the files from a specific path.
the script works just great in the RHEl 5.2, now i got the job to implement the same script in an RHEL 3.6, i thought, great just copy my other script and modify some paths and voila it should work
well that didnīt go so well.. the script creates a small 8 kb tgz file and leaves all the old files in there places...
here is the script:
Code:
cd /opt/delscript/
find /home/chroot/jail/* -type f -mtime +30 -print0 | xargs -0 tar czfpX /home/backup/Del_script_backup_$(date +%y%m%d).tgz Exclude --remove-files
find /home/backup/* -type f -name "Del_script_backup_*.tgz" -mtime +3 -exec rm -f {} \;
Here is the exclude file that Tar uses:
Code:
/home/backup/*
/home/chroot/*/dev/*
/home/chroot/*/etc/*
/home/chroot/*/lib/*
/home/chroot/*/usr/*
*.ssh*
*id_dsa.pub*
*id_rsa*
id_rsa.pub
*keys
*.bash_history
*.bash_logout
*.bash_profile
*.bashrc
*.gtkrc
*.kde
Anyway when i do the Find part of the script it finds all the files, but it is probably the Tar part that is different from RHEL 5 in some way that I canīt seame to find...
I appreciate any help i can get!
/Peter