Skip to content

Instantly share code, notes, and snippets.

@telatin
Last active October 29, 2020 11:37
Show Gist options
  • Save telatin/3ddfd39ebfdf2342183aea34f4d04ee2 to your computer and use it in GitHub Desktop.
Save telatin/3ddfd39ebfdf2342183aea34f4d04ee2 to your computer and use it in GitHub Desktop.
#!/bin/sh
EXT='fastq.gz'
USER=ftp-username
PASS=ftp-password
HOST=ftp.host
REMOTEDIR=uploads/
# see "-z" to try to resume transfers
#ncftpput -u "$USER" -p "$PASS" "$HOST" "$REMOTEDIR" *.$EXT
for FILE in *.$EXT;
do
if [ ! -e "$FILE.done" ]; then
ncftpput -u "$USER" -p "$PASS" "$HOST" "$REMOTEDIR" "$FILE" && touch $FILE.done
else
echo "Skipping $FILE"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment