aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-07-10 15:04:38 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-07-10 15:04:38 -0300
commit932ffe9e41fd3c0d2369f6addf860dafdd0b8ee1 (patch)
tree14395aac507e15d1952ce250bf9808c758cd9554
parenta3a472298878996dc00273e58efcbfcdf53039fd (diff)
downloadhydra-932ffe9e41fd3c0d2369f6addf860dafdd0b8ee1.tar.gz
hydra-932ffe9e41fd3c0d2369f6addf860dafdd0b8ee1.tar.bz2
Check if folder exist at sync-tpc
-rwxr-xr-xshare/hydractl/sync-tpc9
1 files changed, 5 insertions, 4 deletions
diff --git a/share/hydractl/sync-tpc b/share/hydractl/sync-tpc
index 5b990bb..a785fb9 100755
--- a/share/hydractl/sync-tpc
+++ b/share/hydractl/sync-tpc
@@ -33,10 +33,11 @@ for folder in /mnt/crypt/home/*; do
done
# Sync files
-$SUDO $RSYNC /home/ $DEST/home/
-$SUDO $RSYNC /var/cache/pbuilder/ $DEST/var/cache/pbuilder/
-$SUDO $RSYNC /var/chroot/ $DEST/var/chroot/
-$SUDO $RSYNC /var/lib/wicd/ $DEST/var/lib/wicd/
+for folder in /home /var/cache/pbuilder /var/chroot /var/lib/wicd; do
+ if [ -d "$folder" ]; then
+ $SUDO $RSYNC $folder/ $DEST/$folder/
+ fi
+done
# Network config
$SUDO cp -a /etc/network/interfaces $DEST/etc/network/interfaces