Add a script to copy torrent files

This commit is contained in:
Jonny Barnes 2025-03-16 16:13:47 +00:00
parent a3e8d9d424
commit 761378d9b8
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
2 changed files with 24 additions and 0 deletions

21
bin/cp-torrent Normal file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env zsh
# Copy .torrent files to my server
local torrentFile="$1"
if [[ ! (-e $torrentFile) ]]
then
echo "The specified file does not exist"
exit 1
fi
if [[ ! ($torrentFile =~ (torrent$)) ]]
then
echo "File specified must be a torrent file"
exit 1
fi
# rsync the file over
rsync --remove-source-files --compress --compress-choice=zstd --compress-level=22 $torrentFile jmbhetz:~/.torrents/

View file

@ -48,6 +48,9 @@ ln -s $BASEDIR/neovim $HOME/.config/nvim
echo "For compatability we chall copy the global gitconfig" echo "For compatability we chall copy the global gitconfig"
cp $BASEDIR/gitconfig $HOME/.gitconfig cp $BASEDIR/gitconfig $HOME/.gitconfig
# Copy the progs into the local bin dir
rsync -av --chmod=+x $BASEDIR/bin/ $HOME/.local/bin/
# Source zshrc # Source zshrc
echo "And finally, source the .zshrc" echo "And finally, source the .zshrc"
source $HOME/.zshrc source $HOME/.zshrc