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