I used rsync
for creating a backup copy:
bash-3.2$ rsync -tvrog /export/home/kent/Scripts /export/home/kent/TEST_Scripts_rsync
With these options:
Options:
-v, --verbose increase verbosity
-r, --recursive recurse into directories
-o, --owner preserve owner (super-user only)
-g, --group preserve group
Observe the Source directory contents:
bash-3.2$ cd /export/home/kent/Scripts
bash-3.2$ ls -l
total 170
-rw-r--r-- 1 kent kent 74 Feb 5 07:10 1.sh
drwxr-xr-x 2 kent kent 2 Jun 17 06:21 456
-rwxrwxrwx 1 kent kent 355 Feb 5 07:10 App_recreate.msh
...
Destination:
bash-3.2$ cd TEST_Scripts_rsync/Scripts/
bash-3.2$ ls -l
total 168
-rw-r--r-- 1 kent kent 74 Feb 5 07:10 1.sh
drwxr-xr-x 2 kent kent 2 Jun 17 06:21 456
-rwxr-xr-x 1 kent kent 355 Feb 5 07:10 App_recreate.msh
...
Note that the permissions have changed for App_recreate.msh
. So is there a way to preserve the permissions at the least if not also preserve the last modified date?
Note that I traversed all the directories from /
to /export/home/kent/
but couldn't find a sticky bit that might be responsible for masking the permissions.
Note:
- Once done, I may have to do an incremental backup using rsync - so I guess simply tar-ing the files wouldn't be of much help.