REQUEST: Run special SSH commands

EcpHosting

Well-Known Member
Dec 16, 2002
69
0
156
I would like a script to be able to run commands similiar to the following:

cd /home/user/
wget http://www.domain.com/file.tar
tar -xf file.tar
del -f file.tar
mv /home/user/file /usr/local/lib

... and a list of other root commands, to be performed after every day after each CP update. I know there has to be some easy way I have not heard of yet, but this would be a script to be run from cron... i just dont know how to program this script... of course it's not a simple cron as its extracting files in specific folders... unless you know a cron command to do this. :D

Any folks know of a way to do this? I would be most grateful.
 

rpmws

Well-Known Member
Aug 14, 2001
1,787
10
318
back woods of NC, USA
Originally posted by EcpHosting
I would like a script to be able to run commands similiar to the following:

cd /home/user/
wget http://www.domain.com/file.tar
tar -xf file.tar
del -f file.tar
mv /home/user/file /usr/local/lib

... and a list of other root commands, to be performed after every day after each CP update. I know there has to be some easy way I have not heard of yet, but this would be a script to be run from cron... i just dont know how to program this script... of course it's not a simple cron as its extracting files in specific folders... unless you know a cron command to do this. :D

Any folks know of a way to do this? I would be most grateful.
I am no expert but I **think** you can simply add those to a flat file and save it as a script.sh file and then run that file from the cron.

Try putting those in a file and then running the script.sh to see if the rest are executed also. Once you get it working just cron that sucker :)
 

ecoutez

Well-Known Member
May 23, 2002
152
0
316
Re: Re: REQUEST: Run special SSH commands

Originally posted by rpmws
I am no expert but I **think** you can simply add those to a flat file and save it as a script.sh file and then run that file from the cron.
Yup - just don't forget a hash bang
- Jason