Executing this script halts it after the tar with the following message.

--
#!/bin/sh
tar -zcvf bak.tar.gz /home/user/Documents &&
gpg -r backup@user.local -e bak.tar.gz &&
rm -rf bak.tar.gz &&
rsync -vac --delete /home/user/Documents/bak.tar.gz.gpg /media/user/6548-2136 
&&rm -rf bak.tar.gz.gpg

tar: file changed as we read it.
--

I've split the script into two parts.

script 1
--
tar -zcvf bak.tar.gz /home/user/Documents &&

&

script 2
--
gpg -r backup@user.local -e bak.tar.gz &&
rm -rf bak.tar.gz &&rsync -vac --delete /home/user/Documents/bak.tar.gz.gpg 
/media/user/6548-2136 &&rm -rf bak.tar.gz.gpg

--

Everything works. When setting the scripts up as cronjobs with script 2 several 
minutes behind each script 1. The backup file ends up stuck in my home 
directory .

LinuX

Reply via email to