Last active
June 3, 2020 17:46
-
-
Save drewdickenson/5d5f17bdb5e7970d40c71a002b9e7fb8 to your computer and use it in GitHub Desktop.
Sync TV and Clean TV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################### Crontab Info ####################### | |
0 23 * * * ~/synctv.sh | |
0 0 * * 7 ~/syncmov.sh | |
0 22 15 * * ~/cleantv.sh | |
0 22 16 * * ~/cleanmov.sh | |
##################### synctv.sh ######################### | |
#! /bin/bash | |
if mountpoint -q ~/NASMedia | |
then | |
rsync --log-file=$HOME/.rsyncd.log -rltvzu /home/dd/Media/TV/ /home/dd/NASMedia/TV/ | |
else | |
sudo mount -a | |
if mountpoint -q ~/NASMedia | |
then | |
rsync --log-file=$HOME/.rsyncd.log -rltvzu /home/dd/Media/TV/ /home/dd/NASMedia/TV/ | |
fi | |
fi | |
################### cleantv.sh ################################ | |
#! /bin/bash | |
if mountpoint -q ~/NASMedia | |
then | |
rsync --log-file=$HOME/.rsyncd.log -avz /home/dd/Media/TV/ /home/dd/NASMedia/TV/ --delete | |
else | |
sudo mount -a | |
if mountpoint -q ~/NASMedia | |
then | |
rsync --log-file=$HOME/.rsyncd.log -avz /home/dd/Media/TV/ /home/dd/NASMedia/TV/ --delete | |
fi | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment