#!/bin/bash # frode klevstul : start 25.05.11 : restart pcloud and synology-drive, as pcloud issues hinder continous syncing # 900 sec = 15 minutes secs=900 while true do if pidof cloud-drive-ui ; then echo "kill synology-drive" # pkill: pattern that searches for process name longer than 15 characters will result in zero matches, so: pidof cloud-drive-connect | xargs kill -15 pkill -15 cloud-drive-ui sleep 10 else echo "Synology-Drive is not running, so no killing is neccessary (this time around…)" sleep 1 fi if pidof pcloud ; then echo "kill pcloud" pkill -15 pcloud sleep 10 else echo "pCloud is not running, so no killing is neccessary (this time around…)" sleep 1 fi echo "start pCloud" pcloud & sleep 5 echo "start Synology-Drive" synology-drive & sleep 5 echo "sleep for ${secs} seconds, wake up, repeat (ctrl+c to stop)" sleep ${secs} done