forked from kamos69/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backups.sh
executable file
·67 lines (55 loc) · 1.77 KB
/
backups.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
echo "Starting Backup on $(date)"
# Set backup path
BK_PATH=/home/$USER/backups
### Sickrage
# File location
SR_PATH=/home/$USER/.sickrage
# Create archive
/bin/tar -cvf $BK_PATH/sickrage/sickrage-`date \+%Y\%m\%d`.tar.gz "$SR_PATH/config.ini" "$SR_PATH/cache.db" "$SR_PATH/sickbeard.db" "$SR_PATH/cache" "$SR_PATH/failed.db"
### CouchPotato
# File location
CP_PATH=/home/$USER/.couchpotato
# Create archive
/bin/tar -cvf $BK_PATH/couchpotato/couchpotato-`date \+%Y\%m\%d`.tar.gz "$CP_PATH/settings.conf" "$CP_PATH/database"
### Rtorrent
# File location
RT_PATH=/home/$USER
# Create archive
/bin/tar -cvf $BK_PATH/rtorrent/rtorrent-`date \+%Y\%m\%d`.tar.gz "$RT_PATH/.sessions/" "$RT_PATH/.rtorrent.rc"
### PlexPy
# File location
PP_PATH=/opt/plexpy
# Create archive
sudo /bin/tar -cvf $BK_PATH/plexpy/plexpy-`date \+%Y\%m\%d`.tar.gz "$PP_PATH/config.ini" "$PP_PATH/plexpy.db"
### Ombi
# File location
OMBI_PATH=/opt/plexrequests
# Create archive
sudo /bin/tar -cvf $BK_PATH/ombi/ombi-`date \+%Y\%m\%d`.tar.gz "$OMBI_PATH/Ombi.sqlite"
### Crontabs
crontab -l > $BK_PATH/cron-backup.txt
### Scripts
# File location
SCRIPTS_PATH=/home/$USER/scripts/
# Create archive
sudo /bin/tar -cvf $BK_PATH/scripts/scripts-`date \+%Y\%m\%d`.tar.gz $SCRIPTS_PATH
### Plex
# File location
PLEX_PATH=/var/lib/plexmediaserver/
# Rsync to backup folder
sudo rsync -azv $PLEX_PATH $BK_PATH/plex/
### Rclone
# Rsync to backup folder
sudo rsync -azv /home/$USER/.rclone.conf $BK_PATH/
### Config
# File location
CONFIG_PATH=/home/$USER/.config/
# Create archive
sudo /bin/tar -cvf $BK_PATH/config/config-`date \+%Y\%m\%d`.tar.gz $CONFIG_PATH
### Sync to Cloud
# File Location
ACD_PATH=backups:
# Rclone sync to ACD
sudo chmod -R 775 $BK_PATH
/usr/bin/rclone sync --transfers=100 --checkers=100 $BK_PATH/ $ACD_PATH