Richard Bostrom
2024-07-14 08:20:02 UTC
Executing this script halts it after the tar with the following message.
--
#!/bin/sh
tar -zcvf bak.tar.gz /home/user/Documents &&
gpg -r ***@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 ***@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
--
#!/bin/sh
tar -zcvf bak.tar.gz /home/user/Documents &&
gpg -r ***@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 ***@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