The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Accessing variables of one shell script in another shell script rsendhilmani Shell Programming and Scripting 2 03-17-2009 01:17 AM
How to pass a parameter from one Shell-script to another Shell-script subodhbansal Shell Programming and Scripting 2 09-22-2007 06:19 AM
How to Run a shell script from Perl script in Parent shell? hifake Shell Programming and Scripting 16 08-28-2007 09:42 PM
Script to download file using wget techie82 Shell Programming and Scripting 1 02-13-2007 07:45 PM
Automatic download of csv file using a shell script figaro Shell Programming and Scripting 1 01-13-2007 08:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-04-2007
moorthygs moorthygs is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 6
Shell script for FTP download

Dear All,

I have to download files from FTP server every monday. Presently i am downloading manually. I am thinking to put this into cron jobs.

I am new in shell. Please advise to tune this script effectively.

Also could anyone explain to add this into cron jobs...

I have to download four folders. Each folders contain more than 200 files size of around 500 MB. Once download is over, that files to be replaced into our local server.

This is my script...

#!/bin/bash -vx
ftp -in 10.41.141.14<<END_SCRIPT
quote USER abc
quote PASS xxxx
bin
prompt off
cd /csi/endeca_chrome/dgraph_input -- this folder contains files...
lcd /space/endeca_chrome/endeca/files/data/dgraph_input/mirror0/partition0/ -- this location is local directory for file replace...
mget *
bye
END_SCRIPT

Last edited by moorthygs; 09-04-2007 at 11:20 AM..
  #2 (permalink)  
Old 09-04-2007
ajcannon ajcannon is offline
Registered User
  
 

Join Date: Aug 2007
Location: Binfield, Berkshire. UK
Posts: 91
Adding to crontab

As regards getting your script into crontab - log in as the user who needs to run the script and type crontab -e.
This will open 'your' crontab in VI. consult man crontab for the format you have to use to define when your script is to be invoked by cron. You can define seconds, minutes, hours, days, days of month etc etc.
Each username has their own crontab - running crontab -e allows your to edit your own one.
  #3 (permalink)  
Old 09-05-2007
moorthygs moorthygs is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 6
crontab

Hey,

still i am not run the script using cron tab. Before i want the confrimation my script is correct or not?

i am new for scriptring...

I can download using mget in command line from ftp. But It's take long time to download compare than manual download using tools.

my crontab entries to be 00 3 * * 1 -- every monday morning 3 am my script will execute.

Please advise...

Thanks,
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0