...
 
Commits (2)
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
# Author: Kai Lorenz # Author: Kai Lorenz
# Last update 24.02.2019 # Last update 24.02.2019
if (( EUID != 0 )); then
echo "Please execute this script as root (sudo su)." 1>&2
exit 1
fi
ls /home/ ls /home/
echo "Please enter the target username" echo "Please enter the target username"
read varTargerUser read varTargerUser
...@@ -14,5 +19,5 @@ then ...@@ -14,5 +19,5 @@ then
varArchiveName=$({ date +%Y; echo -; hostname; echo -; echo $varTargerUser; } | sed ':a;N;s/\n/ /;ba' | tr -d '[:space:]') varArchiveName=$({ date +%Y; echo -; hostname; echo -; echo $varTargerUser; } | sed ':a;N;s/\n/ /;ba' | tr -d '[:space:]')
mkdir /move mkdir /move
tar --exclude='/home/$varTargerUser/.local/share/Trash/' --exclude='/home/$varTargerUser/.cache/mozilla' --exclude='/home/$varTargerUser/.wine' --exclude='/home/$varTargerUser/.cache/google-chrome' --exclude='/home/$varTargerUser/.cache/pip' --exclude='/home/$varTargerUser/.cache/thumbnails' -zcvpf /move/$varArchiveName.tar.gz /home/$varTargerUser tar --exclude='/home/$varTargerUser/.local/share/Trash/' --exclude='/home/$varTargerUser/.cache/mozilla' --exclude='/home/$varTargerUser/.wine' --exclude='/home/$varTargerUser/.cache/google-chrome' --exclude='/home/$varTargerUser/.cache/pip' --exclude='/home/$varTargerUser/.cache/thumbnails' -zcvpf /move/$varArchiveName.tar.gz /home/$varTargerUser
mv -uv /move/* /mnt/nfs/webis20/code-in-archive/account-graveyard mv -uv /move/varArchiveName* /mnt/nfs/webis20/code-in-archive/account-graveyard
fi fi