Force relative paths in tar

This commit is contained in:
Daniel Flanagan 2021-02-18 13:30:21 -06:00
parent 7cdad89918
commit c757c40ce7
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4

View file

@ -13,9 +13,11 @@ if not test -d $argv[1]
exit 1 exit 1
end end
set fn (date +%Y%m%d_%H%M%S)(basename $argv[1]) set fn (date +%Y%m%d_%H%M%S)(basename $argv[1])
tar -cvf - $argv[1] 2>/dev/null | pushd (dirname $argv[1])
tar cvf - (basename $argv[1]) 2>/dev/null |
zstd --ultra -T2 -22 | zstd --ultra -T2 -22 |
gpg --encrypt --recipient daniel@lyte.dev | gpg --encrypt --recipient daniel@lyte.dev |
ssh $host "cat - > $dir/$fn$ext" ssh $host "cat - > $dir/$fn$ext"
popd
# TODO: checksum? # TODO: checksum?
echo "Uploaded to host rift via ssh at $dir/$fn$ext" echo "Uploaded to host rift via ssh at $dir/$fn$ext"