09-10-2007
Quote:
Originally Posted by
moorthygs
Dear All,
Please to be inform you,I have posted one thread on this forum last 5 days back. I was not getting suggestions for my thread. So i am creating a new thread with detailed of my R&D.
I am new in Shell Scripts, Perl and Cron Jobs. I have one requirement in Cron jobs for FTP Download. Presently i am
downloading around 600 MB files from ftp server manually in every monday. This will affect our internet bandwidth
during office hours. For avioding this, i am planning to schedule cron jobs for my download process.
Download Process to be performed in SUSE Linux. Becoz Downloaded files to be replaced into that server only.
My requirement,
1) I have to stop my server before start the download process. I have given below scripts for stop server process
manually.
login as endeca
password end123
a)endeca# . .endeca_apt
b)endeca# cd bin/
c)endeca/bin# RunCommand apt_control.script apt_stop
a)endeca# . .endeca_auto
b)endeca# cd bin/
c)endeca/bin# RunCommand auto_control.script auto_stop
a)endeca# . .endeca_chrome
b)endeca# cd bin/
c)endeca/bin# RunCommand chrome_control.script chrome_stop
a)endeca# . .endeca_babe
b)endeca# cd bin/
c)endeca/bin# RunCommand babe_control.script babe_stop
How can i write scripts with should be stopped my server process in differnt user?
2) I have to download files from four source folders Like /Source/Dumps1/*, /Source/Dumps2/*, /Source/Dumps2/*,
/Source/Dumps2/*. This will possible on root user only.
FTP Host is 10.10.10.100 port 21
user abc
password defgh
3) Downloaded files are replaced into my Destination folder like /space/endeca/apt/, /space/endeca/auto/,
/space/endeca/chrome/, /space/endeca/babe/ - This will possible on root user only. Is there need to delete the old
files in that four folders?
4) Once Files are moved into destination path. I have to change the ownership of that files like below
root# chown endeca:endeca /space/endeca/apt
root# chown endeca:endeca /space/endeca/auto
root# chown endeca:endeca /space/endeca/chrome
root# chown endeca:endeca /space/endeca/babe
5) Once change ownership is over, i have to restart the server process
login as endeca
password end123
a)endeca# . .endeca_apt
b)endeca# ./start_em.sh
c)endeca# cd bin/
d)endeca/bin# RunCommand apt_control.script apt_start
a)endeca# . .endeca_auto
b)endeca# ./start_em.sh
c)endeca# cd bin/
d)endeca/bin# RunCommand auto_control.script auto_start
a)endeca# . .endeca_chrome
b)endeca# ./start_em.sh
c)endeca# cd bin/
d)endeca/bin# RunCommand chrome_control.script chrome_start
a)endeca# . .endeca_babe
b)endeca# ./start_em.sh
c)endeca# cd bin/
d)endeca/bin# RunCommand babe_control.script babe_start
I have written ftp scripts for download. My doubt is i have to write four script for downloading four folders. Also
i have to schedule four cron jobs for my tasks.
#!/bin/bash -vx
ftp -in 10.10.10.100<<END_SCRIPT
quote USER abc
quote PASS defgh
bin
prompt off
cd /Source/Dumps1/
lcd /space/endeca/apt/
mget *
bye
END_SCRIPT
Please don't take bore of my post.
Thanks in advance,
Moorthy.GS
You can do the task by means of a single shell script itself and by means of a single cron?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am a total newbie to all things Unix. I've worked out I need to set up something that will allow me to automatically backup a DB for me, the DB is for a foum system I run.
Now, I've only found out I need to use telnet for this, and worked out hwo to log into telnet today. From here... (4 Replies)
Discussion started by: eludlow
4 Replies
2. Shell Programming and Scripting
hi folks,
I need an explanation on cron jobs with an example (4 Replies)
Discussion started by: vijaysabari
4 Replies
3. UNIX for Dummies Questions & Answers
I was wondering if itīs possible to cron job not to run on a certian day and time. Iīve got a job that runs everyday at 08:00
but would like it not to run on the 20:th between 08:00 and 10:00
Anyone know if this is possible, and if. How do i do it?
regards...
dOzY (3 Replies)
Discussion started by: dozy
3 Replies
4. Solaris
whats up,
Have some questions about cron jobs, I am fairly new to the unix os.
My cronjob sends all output to my mail, does anyone know how to redirect output to come out on the screen???
Thanks...... (6 Replies)
Discussion started by: lewisoco
6 Replies
5. Solaris
I'm trying to run cron jobs to start any inhibited processes after a system reboot.
I can schedule th cron, but i'm confused as to how to incorporated the reboot, since reboot is scheduled at different times, once every month.
How can I write this to start every 15 min after after a reboot
... (2 Replies)
Discussion started by: Remi
2 Replies
6. Linux
I created a php script.
I'd like to have it run as a cron job every day at 10:30am. So i added
30 10 * * * /script.php to the cron file
Is it possible to run the script on the command line to test it out ? (1 Reply)
Discussion started by: dannyd
1 Replies
7. UNIX for Advanced & Expert Users
I need to start a job every friday night at 8:00 P.M , it runs all the day on Sat and Sun....can somebody tell me how to do this...I understand crontab...but haven't used it.........can u write some steps.....how to create a file and call.....I honestly dont know? Plz help.Thanks (2 Replies)
Discussion started by: RubinPat
2 Replies
8. Linux
Hi,
I am a Linux administrator (newbie) in my company. The distro being used in the servers here is Centos 5.3
Just need to know, as a Linux administrator is it better for me to use /etc/crontab to set my cron jobs. I do not want to use the crontab -e to schedule my cron jobs.
That means... (1 Reply)
Discussion started by: anaigini45
1 Replies
9. Solaris
There are two jobs in Solaris , Cron and at jobs..
I know how to disable or enable cron jobs.
How can I enable at jobs and disable it.
Kindly help.
Rj (2 Replies)
Discussion started by: jegaraman
2 Replies
10. Red Hat
I'm running cronjobs on a redhat 5.X. Cronjobs are getting failed frequently so how to find the root cause (2 Replies)
Discussion started by: karthik9358
2 Replies