diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-10-02 15:31:20 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-10-02 15:31:20 -0300 |
commit | d13a337e8bc54ace1ea98ff5faae01d525d9dd21 (patch) | |
tree | c56960960b1c98daa487833d89ef61ab725ab32d | |
parent | b385b9d83d4aa69de834c8e062fa9fff03cdf79b (diff) | |
download | hydra-d13a337e8bc54ace1ea98ff5faae01d525d9dd21.tar.gz hydra-d13a337e8bc54ace1ea98ff5faae01d525d9dd21.tar.bz2 |
Adds sync-tpc
-rwxr-xr-x | share/hydractl/sync-tpc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/share/hydractl/sync-tpc b/share/hydractl/sync-tpc new file mode 100755 index 0000000..2449e1d --- /dev/null +++ b/share/hydractl/sync-tpc @@ -0,0 +1,40 @@ +#!/bin/bash +# +# sync-tpc +# + +# Parameters +BASENAME="$0" +DEST="$1" + +# Syntax +if [ -z "$DEST" ]; then + echo "usage: $BASENAME <dest>" + exit 1 +elif [ ! -d "$DEST" ]; then + echo "folder $DEST does not exist." + exit 1 +fi + +# Sudo +if [ "$USER" != 'root' ]; then + export SUDO="sudo" +fi + +# Encrypted home +$SUDO mkdir -p $DEST/mnt/crypt/home + +# Encrypted mountpoints +for folder in /mnt/crypt/home/*; do + $SUDO mkdir -p $DEST/$folder +done + +# Sync files +$SUDO rsync -av --delete /home/ $DEST/home/ +$SUDO rsync -av --delete /var/cache/virtualbox/ $DEST/var/cache/virtualbox/ +$SUDO rsync -av --delete /var/chroot/ $DEST/var/chroot/ +$SUDO rsync -av --delete /var/cache/pbuilder/ $DEST/var/cache/pbuilder/ +$SUDO rsync -av --delete /var/lib/wicd/ $DEST/var/lib/wicd/ + +# Sync config +$SUDO cp -a /etc/udev/rules.d/70-persistent-net.rules $DEST/etc/udev/rules.d/70-persistent-net.rules |