rsync: mkstemp [...] failed: Operation not permitted (1)

Status
Not open for further replies.

gsezz

Dabbler
Joined
Aug 23, 2015
Messages
17
Hi,
I want to sync the content of a Dataset from one freenas to another, using rsync over ssh. Both use ZFS filesystems. Owner and Group of the files exist on both systems, with identical UID and GID. Both Datasets have CIFS shares, if that matters. My rsync task on push looks like this:

path: /mnt/volume0/Music/
user: root
remote host: *ddns-hostname* (also tried root@ddns-hostname)
rsync mode: rsync over ssh
remote path: /mnt/storage/Music/
validate remote path: yes
direction: push
recursive: yes
times: yes
compress: yes
archive: no
delete: yes
quiet: no
preserve permissions: yes
preserve extended attributes: no
delay updates: yes

rsync creates directories on the target system, but doesnt copy files:
Code:
FreeNAS rsync: rsync: mkstemp "/mnt/storage/Musik/test/.test.txt.Ceh8D0" failed: Operation not permitted (1)
FreeNAS rsync: rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1166) [sender=3.1.1]

Also the directories don't get correct ownership, they are root:usergroup instead of user:usergroup.

Greets, Gsezz
 

gsezz

Dabbler
Joined
Aug 23, 2015
Messages
17
Not until I read you comment. So I can't use rsync with Windows share type. And I shouldn't use Unix share type with CIFS shares. I asume I have to find another way to sync this Datasets. :(
Yes solved, I guess.
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Why can't you use replication
 

gsezz

Dabbler
Joined
Aug 23, 2015
Messages
17
I'd like to, but one location has a very slow and somewhat unstable internet connection. Bigger syncs can take several hours, and if the connection drops during a replication it has to start over again. If itdrops on a regular basis the whole task could get stuck. That couldn't happen with a file based sync, at least if there are no single super large files. ;)
 

desertrider

Dabbler
Joined
Apr 19, 2015
Messages
12
My Solution: I was looking at Bug #1217, for this rsync error, and the programmer mentioned this was by design and you have to use "-A --no-perms" included in your command and when I used it everything worked.

Include "-A --no-perms" in your rsync command and it should now work (hope this helps someone as I was pulling my hair out over this –no-perms )

I know this is an old thread but I had this same issue with ZFS datasets, share type=Windows, and using SMB shares. In SSH (I use Putty), using rsync to copy files from one dataset to another would copy directories but NOT the files and you would get an error regarding the mkstemp failed - also it continues but if you have a lot of files it will stop

I had --progress with --stats and it just quit in my Putty SSH window - I was able to hit Ctrl-C to cancel and then I could see it trying to write all the mkstemp files into the directories but got mkstemp failed operation not permitted.

Here is my total WORKING command, used in Putty SSH, I use to copy files from one directory to another along with getting progress & stats:
rsync --partial --stats --progress –A –a –r –v --no-perms /mnt/BEAST22T/Videos/ /mnt/MINI7T/Backups_PERMANENT/Videos-New-Location

** You can add the “-n” for test run - it will run and let you know the results without actually copying the files ***

Here is what each of the commands I use is performing - I include for those who may want to use this and customize it:

--no-perms (**Must use –A with this) (MUST HAVE THIS FOR SMB, Windows ACL Shares or you will get directories but not files copied) – this tells it to not preserve permissions.
--perms = -p = preserve permissions (This is the original perms command that we are adding --no-perms

--partial
By default, rsync will delete any partially transferred file if the transfer
is interrupted. In some circumstances it is more desirable to keep partially
transferred files. Using the --partial option tells rsync to keep the partial
file which should make a subsequent transfer of the rest of the file much faster.

--stats
This tells rsync to print a verbose set of statistics on the file transfer,
allowing you to tell how effective the rsync algorithm is for your data.

--progress
This option tells rsync to print information showing the progress of the transfer.
This gives a bored user something to watch.
This option is normally combined with -v. Using this option without the -v option
will produce weird results on your display.

-r, --recursive
This tells rsync to copy directories recursively.
If you don't specify this then rsync won't copy directories at all.

-A --acls
Preserve ACLs (implies –p = --perms which is permissions when using –A you do not need -p)

-a, --archive
This is equivalent to -rlptgoD. It is a quick way of saying you want recursion and
want to preserve almost everything.

-v, --verbose
This option increases the amount of information you are given during the transfer.
By default, rsync works silently.
A single -v will give you information about what files are being transferred
and a brief summary at the end.
Two -v flags will give you information on what files are being skipped and
slightly more information at the end.
More than two -v flags should only be used if you are debugging rsync.

--delete
This tells rsync to delete any files on the receiving side that aren't on - You can add this if you want to us this to keep exact copies on the target as the files change on the source.
 
Last edited:
Status
Not open for further replies.
Top