]> git.somenet.org - somenet/homesync.git/blob - homestore.sh
exclude all nextcloud instances.
[somenet/homesync.git] / homestore.sh
1 #!/bin/bash
2
3 SLEEPTIME=5
4 echo "Will sync ${HOME} TO server in ${SLEEPTIME} sec..."
5
6 if [[ "$1" == "ALL" ]] ; then
7   echo "ALL enabled! This will sync almost all data. Also cross-fs!"
8   sleep $SLEEPTIME
9   rsync -vapP --delete --delete-excluded --sparse --exclude='/.**' --exclude='/Downloads' --exclude='/VirtualBox VMs/*.nosync' \
10         --exclude='/Nextcloud*' \
11         "${HOME}/" "home.somenet.org:HOMESYNC_DATA/"
12
13 elif [[ "$1" == "QUICK" ]] ; then
14   echo "QUICK sync: Will skip VMs."
15   sleep $SLEEPTIME
16   rsync -vapPx --delete --sparse --exclude='/.**' --exclude='/Downloads' --exclude='/VirtualBox VMs' \
17         --exclude='/Nextcloud*' \
18         "${HOME}/" "home.somenet.org:HOMESYNC_DATA/"
19 else
20   echo "Use ALL or QUICK! Doing nothing."
21   exit 1
22 fi
23