am trying to use tar in combination with find, the goal is to all files in /export that have been modified in the last 24 hours (back up purposes), then tar them so I can untar on the backup server, updating just the modified files.
Perhaps there is a better way, however, I have tried using cpio but the problem come in when I copy to the NAS drive (NTFS) I lose all my owner/group and permissions. I have found that if I tar the files, then copy them to the NAS, when I untar on the server, it will retain the owner/group and permissions.
So… here is what I have tried:
First, I use the find command to see what files should be in the tar archive.
/export $ find . -depth -mtime 0 -print
Ok, that looks right, now I will try to pipe that in to tar
/export $ find . -depth -mtime 0 -print0 | tar -czvf backup.tar.gz --null -T -
tar: ./share/pdf/.directory: Cannot open: Permission denied
tar: ./share/PDF: Cannot open: Permission denied
tar: ./share/.directory: Cannot open: Permission denied
tar: ./.directory: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
It seems that it is trying to tar all the files in that directory. When I view the files in backup.tar.gz all of the files from /export are in there not just the modified ones