You are not logged in.
Pages: 1
I have some files I'd like to upload via ftp to a remote server automatically. I've written a script that takes a specific directory and creates a tarball for it, but I'm not sure how to get the ftp utility to log in to the server, push a single file, and then close (without any interaction from me). I've looked over the man pages and I may be missing something but I'm not seeing it.
My second question.
I have a 1.7 git repo and I'd like to push it to a remote repository. The remote machine has 1.6 git on it. I can't really seem to find any information on this specifically, is this something that can reasonably be done?
Offline
Create a .netrc in the $HOME of the user who will be doing the uploading. You must, of course, also make sure that your ftp client honours .netrc configuration.
Google for .netrc details - there's plenty available.
Offline
I was struggling with this some time ago, and I finally solved it like this. Just modify to your needs.
#!/bin/sh
# mpdftp
# though lftp claims to support wildcards, I never got them to work
# instead I wrote this little script to automagically upload music based on mpc searches
# trapd00r.se
ftphost="dopehost"
username="user"
password="pass"
tempfile=$(mktemp)
echo -e "debug\n open -u $username,$password $ftphost" > $tempfile
if [ $# == 0 ]; then
echo -e "Usage: $0 [OPTION]...
-a\t query artist
-al\t query album"
fi
if [ "$1" == "-a" ]; then
files=("$(mpc search artist "$2"|perl -pe 's/(.*\/.*\/).*/$1/')")
elif [ "$1" == "-al" ]; then
files=("$(mpc search album "$2"|perl -pe 's/(.*\/.*\/).*/$1/')")
fi
for file in "${files[@]}"; do
echo "$file"|perl -pe 's/^/mirror -R \/mnt\/Music_1\//g' >> $tempfile
done
lftp -f $tempfile
Offline
Pages: 1