feat(function): auto append date when upload files

This commit is contained in:
Léana 江 2023-02-05 12:53:04 +01:00
parent 1bfda6c5bb
commit 621995cdfe
4 changed files with 24 additions and 2 deletions

View file

@ -1,10 +1,14 @@
function upload
if count $argv >/dev/null
set -f dest_name (file_mantissa $argv)"_"(timestamp)(file_extension $argv)
rsync -r -v --chown=caddy:caddy --chmod=u=rwX,g=rX,o=rX --exclude ".DS_Store" --update --times --compress --delay-updates \
$argv \
earth2077.fr:/srv/http/share/
echo -e "\nhttps://earth2077.fr/share/"(path basename $argv)
earth2077.fr:/srv/http/share/$dest_name
echo "https://earth2077.fr/share/"$dest_name
else
echo "Please append path to a file to be uploaded"
return 1
end
end