run cron on ssh, error message

1

how to run the script below

* * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron"

when i run the script, the error message show as below:

$ * * * * * /usr/bin/wget -O - -q "http://website.com/?q=admin/settings/scheduler/cron"
-sh: CHANGELOG.txt: not found
$ 30 15 * * * /usr/bin/wget -O - -q "http://website.com/?q=admin/settings/scheduler/cron"
-sh: 30: not found

can the script above run in ssh (using putty software)

user1790649

Posted 2012-11-01T07:30:53.777

Reputation: 11

Answers

1

Crontab files are not scripts. They're configuration files for cron, which runs commands periodically. The first five fields of a line specify the schedule, the rest of the line specifies the command to run at those times. See man crontab for how to submit or edit your personal crontab.

Barmar

Posted 2012-11-01T07:30:53.777

Reputation: 1 913

go to terminal and do crontab -e

[code] Edit this file to introduce tasks to be run by cron.

For example, you can run a backup of all your user accounts

at 5 a.m every week with:

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

[/code]

http://i.imgur.com/aFg8C.jpg

is that add */1 * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron" on file above?

if yes, how to save the file?

– user1790649 – 2012-11-01T21:19:53.017

1

Go to your terminal and do

crontab -e 

which will ask you for editor options. select VIM or whichever you are comfortable with. paste this there.

*/1 * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron"

save the file and then things should work

Redirect your commands output to see if things are working. Like this

*/1 * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron" >> /home/../asd.log 2>&!

littlecegian

Posted 2012-11-01T07:30:53.777

Reputation: 141

Go to your terminal and do crontab -e – user1790649 – 2012-11-01T21:19:14.343

what happened ? – littlecegian – 2012-11-01T21:20:20.303

go to terminal and do <br/> crontab -e<br/> <br/><br/>

Edit this file to introduce tasks to be run by cron.<br/> #<br/>

For example, you can run a backup of all your user accounts<br/>

at 5 a.m every week with:<br/>

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/<br/>

<br/><br/>

http://i.imgur.com/aFg8C.jpg<br/>

is that add<br/> */1 * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron" on file above?<br/>

if yes, how to save the file?<br/>

– user1790649 – 2012-11-01T21:55:13.787

littlecegian , sorry, i thought i reply here can add break line, it looks messy here. i have add one more reply below. please take a look there... – user1790649 – 2012-11-01T21:59:37.483

hey there. The editor from the screenshot is called nano. Hence VI commands wont work in there. It is a simple editor. Open the file. Go to the place type the characters. ctrl+s to save. ctrl+x to close. check this out if you have any doubts http://mintaka.sdsu.edu/reu/nano.html. ^x means ctrl+x. cheers

– littlecegian – 2012-11-02T08:18:44.367

0

go to terminal and do
crontab -e

and it redirect to this:

Edit this file to introduce tasks to be run by cron.

#

# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

see the attachment image below http://i.imgur.com/aFg8C.jpg

is that add the code on file above?
*/1 * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron" on file above?

if yes, how to save the file?
i have press "vi" and press escape, but not working.

user1790649

Posted 2012-11-01T07:30:53.777

Reputation: 11