Is there a way to sync a PC with a nextcloud server, but without the desktop GUI?
Syncing should happen as soon as the PC has booted. Even if the user does not log in yet.
I know the nextcloudcmd. I could run a cron job and call ``nextcloudcmd` every N minutes.
But this is not nice.
I really prefer a solution where the sync happens immediately (for example via inotify).
How could this be done?
I think a shell script wrapping nextcloudcmd is just a work-around.
If nextcloud does not provide this, then I will use seafile which can do this. See: https://manual.seafile.com/deploy/start_seafile_at_system_bootup.html
I personally think this is very strange. The GUI can do this. I just want the same thing, but without a GUI. Yes, I could run the GUI in a "fake" framebuffer X environment ... but no, that's too dirty.
This requires basic shell scripting: test for the presence of a lock file, if not present create the lock file, run the update, remove the lock file. This way the
nextcloudcmd
isn't launched several times.Untested proof of concept:
Update: it tests for the running process, so if the script get killed it will run anyway and overwrite the PID.
example, sync folder /backup and the folder Documents in your Remote Nextcloud
it will ask for username and password to log in manually. In case you automate via cron job, you can add --user and --password to log in automatically
Note: You need to install nextcloudcmd first , here is how to install nextcloud client in Linux : https://www.addictivetips.com/ubuntu-linux-tips/install-nextcloud-sync-client-on-linux/
More usage can see this link: https://docs.nextcloud.com/desktop/2.6/advancedusage.html