I have a script I am developing to backup files from various directories onto a windows machine.
Script description:
mv files from various directories
tar all files in that directory
export to windows server for safe keeping, external backups.
The part I am stuck with is how TAR can determine which files in the directories are older than 2 days, then how to move them into a different directory which I can TAR then export.
I have been trying to use the find command as follows but I am inexperienced and haven't found google to be helpful yet.
find $BACKUPDIR1/* -mtime +2 -exec tar zcvf {}.tgz
We have a disk space issue on a db server I am hoping to use this to copy out backup files, it has to be better than just deleting them like we do at the minute.
I appreciate your help, my apologies for the missing code tags