LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-11-2006, 08:13 PM   #1
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 483

Rep: Reputation: 31
Automatic FTP Backup


Hi All,

I have an ftp account through a backup service. I manually do the backup once a week: hit the url, enter my username and password and select my local source folder and the remote destination folder. Since all variable information is fixed (folders, url and login info) it seems that I should be able to automate this process. I don't mauch experience with perl or shell scripting. Is there some easy way for me to do this?

Thanks Much,

aquaboot
 
Old 03-11-2006, 08:29 PM   #2
ckoniecny
Member
 
Registered: Oct 2005
Posts: 162

Rep: Reputation: 30
Create a shell script like the following example:

Code:
ftp backup.server.org << EOF
     user backupuser backuppass
     cd /backup
     lcd /home
     prompt
     mput *
EOF
That will move everything from /home to /backup on the backup FTP server. mput is used to put multiple files and prompt suppresses the question asking. In this case you will want to turn this on because if this is automated, you don't want any questions being asked.
 
Old 03-11-2006, 09:00 PM   #3
aquaboot
Member
 
Registered: May 2005
Location: Berkeley, CA.
Distribution: debain freebsd
Posts: 483

Original Poster
Rep: Reputation: 31
Thanks very much for the nifty script!

-ab
 
Old 06-03-2006, 05:12 PM   #4
DoctorWynn
Member
 
Registered: Nov 2005
Distribution: OpenSuSe 10.1
Posts: 63

Rep: Reputation: 15
Ok, I can't get this to work. I've searched hi and lo and believe it or not, can't find any information on such a simple task. I cannot get ftp to automatically log me in via the script. ALWAYS prompts me for the password therefore making the "automated" process not so automated after all. It appears to accept the user name, but always prompts for the password. What am I doing wrong?? Here is what I have in my script,

Code:
#!/bin/bash
cp /media/usbdisk/dcim/100_fuji/* /home/tom/SnagPixTemp/ebay
rm /media/usbdisk/dcim/100_fuji/*
cd /home/tom/SnagPixTemp/ebay
ftp -i < /home/tom/bin/auto_ftp.txt
exit 0
And here is my "auto_ftp.txt" file,

Code:
prompt
open ftp.mysite.com
user username password
cd public_html/ebay
binary
mput *.jpg
bye
 
Old 06-03-2006, 06:24 PM   #5
ckoniecny
Member
 
Registered: Oct 2005
Posts: 162

Rep: Reputation: 30
Why don't you just do something like this?

Code:
#!/bin/bash
cp /media/usbdisk/dcim/100_fuji/* /home/tom/SnagPixTemp/ebay
rm /media/usbdisk/dcim/100_fuji/*
cd /home/tom/SnagPixTemp/ebay

ftp ftp.mysite.com << EOF
prompt
user username password
cd public_html/ebay
binary
mput *.jpg
bye
EOF

exit 0
 
Old 06-03-2006, 06:34 PM   #6
DoctorWynn
Member
 
Registered: Nov 2005
Distribution: OpenSuSe 10.1
Posts: 63

Rep: Reputation: 15
Quote:
Originally Posted by ckoniecny
Why don't you just do something like this?
Same problem. I'm still being prompted for the password. It will not take it automated for some reason. Any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Backup of files on KDE Desktop tooparam Linux - General 1 01-29-2006 11:55 AM
Automatic backup of specified directories? Spreegem Debian 3 07-28-2005 11:08 PM
Automatic backup over LAN synecdoche Linux - General 1 06-12-2004 01:21 AM
Automatic Backup? Mirra? naloxone Linux - Software 0 04-28-2004 04:27 AM
Automatic Backup Usiag taper?? ptom98 Linux - Software 0 07-31-2003 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration