aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/backup-usb32.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/backup-usb32.sh b/bin/backup-usb32.sh
index 6dd038f..3a0002e 100755
--- a/bin/backup-usb32.sh
+++ b/bin/backup-usb32.sh
@@ -1,8 +1,24 @@
#!/usr/bin/env bash
-rsync -az -u -v /mnt/32 ~/Documents/32.bak/
+if [ "$#" -ne 6 ]; then
+ echo "Usage: $0 <source_directory> <local_destination_directory> <remote_destination_directory> <username> <server_address> <ssh_port>"
+ exit 1
+fi
+
+source_directory="$1"
+local_destination_directory="$2"
+remote_destination_directory="$3"
+username="$4"
+server_address="$5"
+ssh_port="$6"
+
+# Backup USB key to local machine
+rsync -az -u -v "$source_directory" "$local_destination_directory"
# --archive, -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H)
# --compress, -z compress file data during the transfer
# --update, -u skip files that are newer on the receiver
# --verbose, -v increase verbosity
+
+# Backup USB key to server over SSH using the provided port
+rsync -az -u -v -e "ssh -p $ssh_port" "$source_directory" "$username"@"$server_address":"$remote_destination_directory"
ref='/Aniki.git/commit/README.md?h=v3.2.3&id=d9a2d9b209f46aff5a47caff1ffcd3de4786e6f6&follow=1'>Update README.mdClyhtsuriva1-1/+1 2021-05-19Update README.mdClyhtsuriva1-8/+10 2021-05-19Update README.mdClyhtsuriva1-1/+2 2021-05-19Update README.mdClyhtsuriva1-8/+7 2021-05-19Update README.mdrelease/3.2.1Clyhtsuriva1-6/+21 2021-05-19Big updaterelease/3.2Clyhtsuriva55-235/+193 2021-05-19Update README.mdClyhtsuriva1-1/+5 2021-05-14Update README.mdClyhtsuriva1-1/+3 2021-05-14Update README.mdClyhtsuriva1-0/+23 2021-05-14Update README.md and adding logo onto the main screenrelease/3.1Clyhtsuriva2-10/+13 2021-05-14Singletons on all pages : OKClyhtsuriva6-125/+81 2021-05-14Singletons : DetailTopManga : OKClyhtsuriva2-21/+49 2021-05-14Addedd Singletons for TopManga.Clyhtsuriva3-23/+43