Web Hosting Talk







View Full Version : How to create a simple sh script?


hoot
06-22-2002, 05:38 PM
Hi I've just set up a crontap to run a script script.sh once a week (it makes backups). How am I supposed to create the script, I want it to be able to run two commands that I would normally enter in the cp, delete a file and create a mysql dump,
I just plut the scripts in a text file I created using the pico function and put the first ssh (or telent) command the jumped a lind and put the second command, is this right ? in the crontab I just put :
0 0 * * 1 /path/to/file.sh

Will this run the 2 commands ? if not what should I do?

Thanks !

Shyne
06-22-2002, 07:49 PM
No idea what said.

davidb
06-22-2002, 08:00 PM
Asumming ur making bash scripts

http://www.linuxnewbie.org/nhf/intel/programming/introbashscript.html

phpjames
06-23-2002, 01:36 AM
Originally posted by hoot
Hi I've just set up a crontap


What the hell is a crontap? Hahaha

hoot
06-23-2002, 02:52 AM
sorry I meant crontab ! (But I that that it was quite obvious what I meant anyway...

phpjames
06-23-2002, 02:57 AM
Ya I know. Im just messin with you hoot. ;-)

hoot
06-23-2002, 03:25 AM
How would I test the script, would :
sh script.sh
be enough ?
Thanks :)

phpjames
06-23-2002, 03:36 AM
# bash script.sh allways works for me.