Created
April 12, 2023 19:07
-
-
Save mo9a7i/1ad6f6485ee7a490da8db615ff527e4f to your computer and use it in GitHub Desktop.
A script to move files from server to server using ftp
This file contains 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 | |
########################################## | |
# By: Mo9a7i (livehostsupport@gmail.com # | |
########################################## | |
temp="/tmp/$(basename $0).$$" ; trap "/bin/rm -f $temp" 0 | |
remote='176.31.46.12' | |
dire='public_html/hard' | |
ftpu='backup' | |
ftpp='' | |
transtype='binary' | |
echo "user $ftpu $ftpp" > $temp | |
echo "cd $dire" >> $temp | |
echo "$transtype" >> $temp | |
for x in $* | |
do | |
f1=$(basename $x) | |
echo "put $x $f1" >>$temp | |
done | |
echo "quit" >> $temp | |
ftp -n -v $remote < $temp | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment