1

General: I want to run a back-up script during shutdown (not reboot). I've tried tons of systemd's service configuration, but no one is working.

Aim: When PC is shutting down I want to perform a back-up to cloud storage using bash script and rclone utility. Syncing may take some time (up to several minutes) and it requires networking and a user being logged in.

Question: What the appropriate .service file structure for my bash script ? I definitely sure only about these lines in .service file. Meanwhile I still don't know how my service should start and how I should specify networking dependency correctly.

[Unit]
Description=Syncing with MEGA cloud storage.
Conflicts=reboot.target

[Service]
User=yevhenii
Type=oneshot
TimeoutSec=0
StandardOutput=file:/home/yevhenii/Projects/ubuntu-scripts/output.txt
StandardError=file:/home/yevhenii/Projects/ubuntu-scripts/error.txt

[Install]

0 Answers0