Incremental backup script - Tar problem
OK - I've been writing smoe backup scripts recently, but have run in to a problem... tar is archiving everything in anything 1 folder or more depth than I specifically request in the script, and not checking it's date.
That's probably not very clear, so I'll try and explain. Firstly, here's my script: Code:
echo "Starting changes backup..." eg, /home/josh/docs/file.txt will be checked and acted on appropriately, but /home/josh/docs/work/file.txt won't be checked, and will be archived regardless. any ideas what I'm doing wrong? |
Here is an example which may get you going.
The date of the file is checked with the mtime -24 command. #!/bin/bash filename=`date '+%m%d%y'` cd /home/josh find . -depth -type f -name '*' \ -mtime -24 -exec /bin/tar -cvzf \ /home/josh/${filename}.tar.gz {} \; |
All times are GMT -5. The time now is 01:51 AM. |