This guide syncs:
/home/furios/Picturesto your Nextcloud server at:
example.localhost
In the Nextcloud web UI, go to:
Personal settings → Security → Devices & sessions → Create new app password
Copy the generated app password. You will use it when setting up rclone.
sudo apt install rcloneStart the rclone setup:
rclone configCreate or edit a remote with these settings:
type: webdav
url: https://example.localhost/remote.php/dav/files/YOUR_USERNAME
vendor: nextcloud
user: YOUR_USERNAME
pass: YOUR_APP_PASSWORD
rclone lsd Nextcloud.example.localhost:If it lists folders from your Nextcloud, the connection is working.
This copies your local Pictures folder to Nextcloud:
rclone copy /home/furios/Pictures Nextcloud.example.localhost:Photos/Picturesrclone check /home/furios/Pictures Nextcloud.example.localhost:Photos/Picturesmkdir -p ~/.config/systemd/usernano ~/.config/systemd/user/pictures-nextcloud-sync.servicePaste this:
[Unit]
Description=Sync Pictures to Nextcloud
[Service]
Type=oneshot
ExecStart=/usr/bin/rclone copy /home/furios/Pictures Nextcloud.example.localhost:Photos/Pictures --log-file=/home/furios/.cache/pictures-nextcloud-sync.log --log-level INFOSave and exit.
nano ~/.config/systemd/user/pictures-nextcloud-sync.timerPaste this:
[Unit]
Description=Run Pictures Nextcloud sync every 30 minutes
[Timer]
OnBootSec=2min
OnUnitActiveSec=30min
Persistent=true
[Install]
WantedBy=timers.targetSave and exit.
Use systemctl --user, not sudo systemctl --user:
systemctl --user daemon-reload
systemctl --user enable --now pictures-nextcloud-sync.timerCheck the timer:
systemctl --user status pictures-nextcloud-sync.timerCheck the service:
systemctl --user status pictures-nextcloud-sync.serviceView logs:
cat /home/furios/.cache/pictures-nextcloud-sync.logsudo loginctl enable-linger furios