Rsync to Network Share works from cmd but fails from Scheduled Task

2020-03-28 Thread Leon Vanderploeg via rsync
Greetings,

I have written a C program that runs on Windows servers and does overhead
and reporting for backup administration.  The program calls rsync for the
actual data copy function.  It copies data from a remote system to a local
drive and that works fine.  However, I have recently made changes to copy
the data to a mapped drive on a NAS device instead of the local drive.

The changes work fine when run from a command line, but fail when run from
a scheduled task or cron job:
rsync: mkdir "/cygdrive/q/restores" failed: No such file or directory
(2)
rsync error: error in file IO (code 11) at main.c(675) [Receiver=3.1.2]
Note:  The folder already exists and permissions are open for Administrator.

Command line that works is bash command to call the C program under
Administrator login.
Scheduled task built as Administrator with or without highest privileges
fails.
Tried Cron entry built under Administrator and it fails.

Here is the Rsync command (abbreviated) called by the C program:
rsync  -rltgoD --chmod=Du+w,u+r,u+x -e "ssh -p 33222 -i
\"/cygdrive/c/Users/administrator/.ssh/id_rsa\"" --stats --files-from=/...
-vv --exclude-from=/ @remote:/  /cygdrive/q/restores

Note: q is the mapped drive to the NAS share.

So, what can be done to track this down?  Why would running as a scheduled
task or cron job fail when command line works?  I am willing to do any kind
of tracing if someone can provide directions on how to do that.

Thanks in advance,
Leon
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: osx permission issue

2020-03-28 Thread Perry Hutchison via rsync
Roland via rsync  wrote:
> does somebody know how to circumvent that "extra file access restriction
> feature" introduced in osx some time ago ?

It may not be possible.

Based on experience with FreeBSD, from which much of OSX is derived,
I suspect you may be running into issues with "file flags"; check the
OSX documentation for the chflags system call.  In FreeBSD, I've seen
that same error message when rsync attempts an operation that would
violate chflags restrictions.

> i already tried adding rsync binary to programms with "full disk access"
> privilege ( system-prefs -> security & privacy -> privacy -> full disk
> access)?? , since running as root is not sufficient - but it does not work.

"full disk access" likely refers to the ability to read the disk
directly, bypassing the filesystem.  It's used by maintenance
programs like fsck and fsdb, and by some full-disk backup programs,
but it won't help rsync.

> i want to make sure that every file on osx is getting backup
>
> i run rsync on linux to remotely backup osx system (via ssh).
>
> regards
> roland
>
> rsync:
> readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/0/com.apple.routined")
> failed: Operation not permitted (1)
> ...

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: osx permission issue

2020-03-28 Thread Roland via rsync

what makes you believe that ssh is accessing the files ?

ok, rsync on remote mac is being spawned by sshd, so i gave full disk
access to the sshd binary , too (as it may inherit restrictions to sub
processes) and restarted ssh service ,

but unfortunately it makes no difference.

did you mean that or something different ?

roland

Am 28.03.20 um 16:20 schrieb Ben Bass:


Hi Roland.

You might have to give ssh full disk access on the remote Mac, as that
is what is accessing the files according to the Mac.

On Sat, Mar 28, 2020 at 9:12 AM Roland via rsync
mailto:rsync@lists.samba.org>> wrote:

hello,

does somebody know how to circumvent that "extra file access
restriction
feature" introduced in osx some time ago ?

i already tried adding rsync binary to programms with "full disk
access"
privilege ( system-prefs -> security & privacy -> privacy -> full disk
access)  , since running as root is not sufficient - but it does
not work.

i want to make sure that every file on osx is getting backup

i run rsync on linux to remotely backup osx system (via ssh).

regards
roland


rsync:

readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/0/com.apple.routined")
failed: Operation not permitted (1)
rsync:

readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/0/com.apple.Safari/SafariFamily")
failed: Operation not permitted (1)
rsync:

readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/C/com.apple.WebKit.WebContent.Sandbox")
failed: Operation not permitted (1)
rsync:

readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/C/com.apple.QuickLook.thumbnailcache")
failed: Operation not permitted (1)
rsync:

readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/C/com.apple.WebKit.Networking.Sandbox")
failed: Operation not permitted (1)
rsync: opendir
"/private/var/folders/zz/zyxvpxvq6csfxvn_n0sm6d/0" failed:
Operation not permitted (1)
rsync: opendir
"/private/var/folders/zz/zyxvpxvq6csfxvn_n0sm6d/C" failed:
Operation not permitted (1)

# ls -l@ /private/var/folders/zz/zyxvpxvq6csfxvn_n0sm6d/
total 0
drwxr-xr-x@  2 _locationd  _locationd   64  3 Nov  2017 0
 com.apple.rootless     -1
drwx--@ 17 _locationd  _locationd  544 19 Jan 23:03 C
 com.apple.rootless     -1
drwx--@  2 _locationd  _locationd   64  3 Nov  2017 T
 com.apple.rootless      7


--
Please use reply-all for most replies to avoid omitting the
mailing list.
To unsubscribe or change options:
https://lists.samba.org/mailman/listinfo/rsync
Before posting, read:
http://www.catb.org/~esr/faqs/smart-questions.html



--
-Ben
(917) 536-0998
b...@benbass.com

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


osx permission issue

2020-03-28 Thread Roland via rsync

hello,

does somebody know how to circumvent that "extra file access restriction
feature" introduced in osx some time ago ?

i already tried adding rsync binary to programms with "full disk access"
privilege ( system-prefs -> security & privacy -> privacy -> full disk
access)  , since running as root is not sufficient - but it does not work.

i want to make sure that every file on osx is getting backup

i run rsync on linux to remotely backup osx system (via ssh).

regards
roland


rsync:
readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/0/com.apple.routined")
failed: Operation not permitted (1)
rsync:
readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/0/com.apple.Safari/SafariFamily")
failed: Operation not permitted (1)
rsync:
readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/C/com.apple.WebKit.WebContent.Sandbox")
failed: Operation not permitted (1)
rsync:
readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/C/com.apple.QuickLook.thumbnailcache")
failed: Operation not permitted (1)
rsync:
readlink_stat("/private/var/folders/_p/ky_w_lyj6ps7jcnkjkl5ss0mgn/C/com.apple.WebKit.Networking.Sandbox")
failed: Operation not permitted (1)
rsync: opendir
"/private/var/folders/zz/zyxvpxvq6csfxvn_n0sm6d/0" failed:
Operation not permitted (1)
rsync: opendir
"/private/var/folders/zz/zyxvpxvq6csfxvn_n0sm6d/C" failed:
Operation not permitted (1)

# ls -l@ /private/var/folders/zz/zyxvpxvq6csfxvn_n0sm6d/
total 0
drwxr-xr-x@  2 _locationd  _locationd   64  3 Nov  2017 0
    com.apple.rootless     -1
drwx--@ 17 _locationd  _locationd  544 19 Jan 23:03 C
    com.apple.rootless     -1
drwx--@  2 _locationd  _locationd   64  3 Nov  2017 T
    com.apple.rootless      7


--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html