LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-14-2008, 09:03 AM   #1
stuartornum
Member
 
Registered: Feb 2006
Posts: 44

Rep: Reputation: 15
Cron Job - FTP Upload File script


Hi,

I am trying to create a script to ftp upload some backed files from one server to another in CentOS.

I use to do this in SSH, but cannot do this anymore...

Im a bit stuck where to start, I know how to do it manual, with the ftp, put commands etc. However I want the script to run under Cron daily.

Also the filename that I will be uploading will change daily (the date is included in the filename, e.g. filename-2008-02-14.tar.gz). So it might be worth making a temp directory somewhere and upload the contents of the directory, then remove the file after the upload has completed...?

Your thoughts would be great.

Thanks
 
Old 02-15-2008, 09:23 AM   #2
cornish
Member
 
Registered: May 2005
Location: Sussex, England
Distribution: Ubuntu 7.10
Posts: 131

Rep: Reputation: 15
Have you thought about using Rsync??

You can set up one way or two way synchronization between two computers?
If you want to know more then let me know?
 
Old 02-15-2008, 12:13 PM   #3
stuartornum
Member
 
Registered: Feb 2006
Posts: 44

Original Poster
Rep: Reputation: 15
Hi cornish,

I can only use FTP as its a shared hosting environment.

Thanks
 
Old 09-23-2012, 12:34 PM   #4
tulioribeiro
LQ Newbie
 
Registered: May 2012
Location: Brazil - Santa Catarina
Posts: 8

Rep: Reputation: Disabled
Shell Script to send file using ftp.

Middle of you script.sh or whatever

filename=NameOfFile.tar.gz"
hostname="10.1.2.6"
username="user_ftp"
password="pass_ftp"
ftp -n $hostname <<EOF
quote USER $username
quote PASS $password
binary
put $filename
quit
EOF


Ps.: all script can be viewed here: http://gt-inside.com.br/answer.php?a...id=92&hits=358
but are in Portuguese.

Att,

Tulio Ribeiro.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
In plesk , I wish to have a backup cron job, ftp back up file to another ftp server? muskiediver Linux - General 6 07-16-2009 03:13 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
FTP cron job dad1001 Linux - Networking 1 07-22-2006 11:42 PM
cron job to send file via ftp every 1 hour mcalizo Linux - Newbie 1 07-14-2004 03:50 AM
Can I make a Cron job to synch/transfer a file from a folder to another FTP?... read efishta Linux - General 6 07-19-2003 10:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:15 AM.

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