Last active
October 22, 2015 05:18
-
-
Save hazcod/f6b9e9fc33064482e35b to your computer and use it in GitHub Desktop.
Small script to tar and send over SSH for large compressed files. Rsync is too slow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IN_DIR=/volume1/Media/Films | |
OUT_DIR=/mnt/media/movies | |
[email protected] | |
if [ ! -z "$1" ]; then | |
IN_DIR="$1" | |
fi | |
if [ ! -z "$2" ]; then | |
OUT_DIR="$2" | |
fi | |
echo "Transferring from $IN_DIR to $OUT_DIR on $REMOTE" | |
ssh "$REMOTE" "mkdir -p $OUT_DIR" | |
for file in "$IN_DIR"; do | |
echo "Transferring $file" | |
tar -cp -C "$IN_DIR" "$file" | ssh -c arcfour "$REMOTE" "cat > $OUT_DIR/$file.tar" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment