cron ftp job help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers cron ftp job help
# 1  
Old 11-09-2007
cron ftp job help

I am new to cron and am trying to set a cron job that will run everyday at 2 to go out to a server (via ftp with user name and password) and get a file and then bring it back to my sever. Below is what I have but it doesn't seem to be working. Any help would be appreciated.

cron command - will run everyday at 2
02***$HOME/html/cron.txt

file named cron.txt (file contents)
#!/bin/sh
HOST="ftp host name"
USER="username"
PASSWD="password"
FILE=mon1.mp3

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0


Thanks for any advice.
# 2  
Old 11-09-2007
Quote:
Originally Posted by bernfuss
get a file
....
put $FILE
Smilie
# 3  
Old 11-09-2007
An eyeroll doesn't help, but can you point me in a direction that will help.

Thanks
# 4  
Old 11-09-2007
You mean you say you want to get a file and yet your script says put?
# 5  
Old 11-09-2007
Thanks, I will change to get $FILE
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

4. UNIX for Advanced & Expert Users

cron job to extact lines from files to another file and ftp to new server

i have a text file in this format: which creates a new one everyday in the form of filename _zing__r200_2012_8_10_log.txt Fri Aug 10 07:29:17 EDT 2012, usera(192.168.0.245) to anotheruser: hey top, this is a private test Fri Aug 10 07:29:28 EDT 2012, anotheruser(192.168.0.245) to usera: got... (2 Replies)
Discussion started by: bkkid
2 Replies

5. UNIX for Dummies Questions & Answers

If FTP cron job fails to connect = quit

Im having a problem with my ftp CRON jobs. I have another related (but not the same question in shell scripting). My FTP CRON jobs connect to a server and drop some files off, if for some reason it cannot connect to the server (timesout/password wrong etc) instead of stopping, it tries again... (3 Replies)
Discussion started by: mokachoka
3 Replies

6. Shell Programming and Scripting

Im trying to create a FTP Cron Job

Hello, Im fairly new to this and am hoping for your help in moving forward. 1. I need to carry out a FTP transfer from SERVER1 to SERVER2 at 3am every morning. 2. The FTP is to work on SERVER1 3. There will be many files to transfer (96 files per day) 4. I want to delete the files... (3 Replies)
Discussion started by: nozerf
3 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. UNIX for Advanced & Expert Users

Cron FTP job

We have a script that we run manually, we want to set it up so that it will run automatically via cron, the problem is during the ftp process nothing is put, the script logs in changes directory fine, but nothing is put to the directory. I have tried it as root, a power user, etc. I have made the... (4 Replies)
Discussion started by: marvin51796
4 Replies

9. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

10. UNIX for Dummies Questions & Answers

ftp in cron job

I am writing a script that will be placed in a crontab, which basically retrieves a file that is overwritten everyday (with current customer data) and then sent to another company. I was wondering what the best way to ensure that ftp was successful and notification of a success or failure message.... (3 Replies)
Discussion started by: walterja
3 Replies
Login or Register to Ask a Question