Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to run a rsync backup Script to backup my data from my HD to my NAS Drive (currently mounted as Samba share, but can change to NFS if that would improve things, if I can work out how!), but when I run the Script I get the following error on every file it tries to copy
Code:
rsync: mkstemp "/media/NASBackups/LinBackup/Documents/Scripts/.backup.sh.lyCSGW" failed: Operation not permitted (1)
As I mentioned I am mounting my Share from my NAS as Samba and below is the fstab entry
It might depend on the actual filesystem type of the NAS drive. For example, if it is vfat you cannot store some information, like owner and group of the files. Note that the -a option is a shortcut for multiple options:
Code:
-a, --archive archive mode; same as -rlptgoD (no -H)
so that you can explicitly apply each of them, just removing the offending ones. For example I would try without -o and -g and perhaps without -p, so that you command line should be:
rn_ - I definately have read/write access to the NAS I have created folders and if I remove the -a from the options, it works fine, but I would rather have this option when the backup is being performed
colucix - Just checked my NAS and it is formatted as ext3, I have also tried rsync with the Options you suggested and I get the same error.
As I mentioned without the -a switch it works fine and also if I try and copy a file manually to the NAS I have no problems. my thoughts are not I need to add something else to my fstab entry (or would NFS give me any benefits?)
colucix - Just checked my NAS and it is formatted as ext3, I have also tried rsync with the Options you suggested and I get the same error.
As I mentioned without the -a switch it works fine
So we have to find out which is the offending option. You should try to remove them one at a time and see what triggers this error. Then you can think about modifying the mount options in /etc/fstab if necessary.
At this point I would start by removing -p, that is run like this:
Thanks for the help, the file that was listed turned out to be a temp file as I had backup.sh open in edit mode when I tried to run the backup last, but I was getting the same error for every file, I was orignally going to use the Back in Time app but I got this error with that so decided to write a simple rsync script myself!
When I try to run the command again with -vv I get the following)
Code:
rsync /media/Data/Gavin/Documents/Scripts/backup.sh -vv -rltgoD --force --delete --ignore-errors /media/NASBackups/LinBackup/Documents/Scripts/
sending incremental file list
delta-transmission disabled for local transfer or --whole-file
backup.sh
rsync: failed to set times on "/media/NASBackups/LinBackup/Documents/Scripts/.backup.sh.eqngD7": Operation not permitted (1)
total: matches=0 hash_hits=0 false_alarms=0 data=1272
sent 1364 bytes received 31 bytes 2790.00 bytes/sec
total size is 1272 speedup is 0.91
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7]
but if I remve all flags except -rl then I get the following instead, I think I tried all other combinations and still got the same error
Code:
rsync /media/Data/Gavin/Documents/Scripts/backup.sh -vv -rl --force --delete --ignore-errors /media/NASBackups/LinBackup/Documents/Scripts/
sending incremental file list
delta-transmission disabled for local transfer or --whole-file
backup.sh
total: matches=0 hash_hits=0 false_alarms=0 data=1272
sent 1347 bytes received 31 bytes 2756.00 bytes/sec
total size is 1272 speedup is 0.92
The mkstemp error in post #1 means the file cannot be opened for reading/writing and most likely this is a problem with the owner of the destination directory. Apparently the /etc/fstab entry indicates the samba share is mounted with your userid, but what about the directories below the mount point? I would deeply investigate the owner/group attributes of the shared filesystem.
The failed to set times error in post #6 again let me think about a problem of ownership: you cannot change the timestamp of a directory if you're not the owner of the directory itself. And usually it needs to be changed if you want to update the content of the directory. However, rsync has an option to avoid the timestamp modification of directories, -O (uppercase o).
Hence you can try to add the -t option again in conjunction with -O. Furthermore you reported that options -o and -g fail. Definitively a ownership issue.
I had a play with changing the fstab entries from mounting the Shares as Samba to nfs and everything now works fine, so I think I must need something else in my fstab if I want to mount as Samba.
Mind you Gnome is doing something Strange it keeps giving me 2 entries in Places for my Backup Share and when I select one of them I am told that it is already busy or mounted!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.