systemctl開機自啓rclone掛載

環境:已安裝配置好onedrive掛載,設置開機自啓
以onedrive爲例(其他也差不多)
不能使用systemctl的請先在root下安裝

apt install systemd-sysv && reboot

1、進入你的systemd目錄,然後創建文件rclone.service
2、

vi rclone.service

3、粘貼,ExecStart替換下

[Unit]
Description=rclone
[Service]
User=root
ExecStart=rclone mount od:/ /root/onedrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
Restart=on-abort
[Install]
WantedBy=multi-user.target

4、鍵盤操作點擊esc,再輸入

:wq

5、如果出現問題,一般都是文件路徑的事情,請自行解決。
6、命令
開機自啓:

systemctl enable rclone

啓動:

systemctl start rclone

重啓:

systemctl restart rclone

停止:

systemctl stop rclone

狀態:

systemctl status rclone

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章