FreeFileSync 13.0
I have very strange error, can not understand why.
Probably this is some OSX problem, but still would like to document it for others and maybe somebody can explain what is the problem.
I was using FreeFileSync automatically from launchd, because I wanted to start it ever time I start PC and then every hour later. I manage to configure it and it was and is still working fine.
This is plist code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.freefilesync</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/FreeFileSync</string>
<string>/Users/macbook/my_scripts/FreeFileSyncSettings_OpalStack.ffs_batch</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
<key>StandardOutPath</key>
<string>/Users/macbook/my_scripts/LOGS/FreeFileSync.stdout</string>
<key>StandardErrorPath</key>
<string>/Users/macbook/my_scripts/LOGS/FreeFileSync.stderr</string>
</dict>
</plist>
Later I decided(for reasons not important for this discussion, but if needed can explain) to make shell script that will be called by launchd.
Here is how my shell script look like:
#!/bin/bash
# for redirecting both outputs to LOG file
exec >> /Users/macbook/my_scripts/LOGS/at_startup_and_every_1h_`date +%Y-%m-%d`.txt
exec 2>&1
echo `date +%Y-%m-%d_%H:%M:%S` " --- START " $$
### FreeFileSync backup
/usr/local/bin/FreeFileSync ~/my_scripts/FreeFileSyncSettings_OpalStack.ffs_batch
# also same problem
#/usr/local/bin/FreeFileSync /Users/macbook/my_scripts/FreeFileSyncSettings_OpalStack.ffs_batch
echo `date +%Y-%m-%d_%H:%M:%S` " --- END " $$; echo
When I run script from terminal it is working fine.
Then I decided to make new plist for launchd. Here is code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.at_startup_and_every_1h</string>
<key>Program</key>
<string>/Users/macbook/my_scripts/at_startup_and_every_1h.sh</string>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>
But when it is tested with "launchctl load com.user.at_startup_and_every_1h.plist" or "launchctl start com.user.at_startup_and_every_1h" I always have error. It is GUI popup.
Cannot open directory "/Users/macbook/Downloads/02_Obsidian_Vaults".
EPERM: Operation not permitted [opendir]
1. Did reboot (few of them) it is the same.
2. Full Disk Access viewtopic.php?t=5706#p18924 is not problem, it is checked.
3. As I said when shell script is run from terminal it is working fine eg. "./at_startup_and_every_1h.sh".
Only idea that I have left is that something, some unknown configuration to me is different when launchd is starting "com.user.at_startup_and_every_1h.plist" and then it is starting "at_startup_and_every_1h.sh".
But I have no idea how to test/confirm it.
Any idea what to do next ?
Thanks