Hi all,
I have written a fairly simple script to back up files. They key bit is this line of code, which finds everything changed in the last day, and makes a tar file containing all those files:
If I change a filename but not the contents, the file isn't picked up by this line of code. I can get 'find' to identify files with changed name by using 'atime' rather than 'ctime'. The problem would be my script would back up everything I had accessed, rather than just those things which had either changed contents or a changed filename. Does anyone have any suggestions as to how to modify the above line to suit my needs? I am trying to avoid a rewrite of the whole script, or adoption of a new method....
Thanks in advance,
wrathkeg
I have written a fairly simple script to back up files. They key bit is this line of code, which finds everything changed in the last day, and makes a tar file containing all those files:
Code:
find . -ctime -1 | xargs tar --no-recursion -czf $HOME/$TARFILE
If I change a filename but not the contents, the file isn't picked up by this line of code. I can get 'find' to identify files with changed name by using 'atime' rather than 'ctime'. The problem would be my script would back up everything I had accessed, rather than just those things which had either changed contents or a changed filename. Does anyone have any suggestions as to how to modify the above line to suit my needs? I am trying to avoid a rewrite of the whole script, or adoption of a new method....
Thanks in advance,
wrathkeg