Run cron on ssh, error message


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run cron on ssh, error message
# 1  
Old 11-01-2012
Run cron on ssh, error message

how to run the script below

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

when i run the script, the error message show as below:
Code:
$ * * * * * /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)
# 2  
Old 11-01-2012
The first five numbers and asterisks are for cron. You don't 'run' that part

If you want to run it with cron, type...
Code:
crontab -e

to edit your crontab file and paste the whole line there.

If you want to run it from the command line, remove the * * * * * or 30 15 * * *.

Last edited by Scott; 11-01-2012 at 05:11 AM.. Reason: Oh, missed a bit!
# 3  
Old 11-01-2012
are you mean like this?

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

how to set time for it?
# 4  
Old 11-01-2012
No, just

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

Sorry, I missed some text in my previous post. Updated.


If you want to run it with cron, type...
Code:
crontab -e

to edit your crontab file and paste the whole line there.

The first five fields (* * * * *, etc) tells cron when to run it. You don't need that on the command line.
# 5  
Old 11-01-2012
Quote:
Originally Posted by Scott
No, just

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

Sorry, I missed some text in my previous post. Updated.


If you want to run it with cron, type...
Code:
crontab -e

to edit your crontab file and paste the whole line there.

The first five fields (* * * * *, etc) tells cron when to run it. You don't need that on the command line.
but i need the server run cron every 10minutes, how to set this?
# 6  
Old 11-01-2012
Why didn't you just ask that from the beginning?

man -s5 crontab
# 7  
Old 11-01-2012
Quote:
Originally Posted by Scott
Why didn't you just ask that from the beginning?

man -s5 crontab
just for confiramtion
after run
/usr/bin/wget -O - -q "http://example.com/scheduler/cron"

than run

man -s5 crontab

is that correct?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Who -u gives different output if run from cron than if run from terminal?

If I run 'who -u' interactively or from a script invoked through bash in a tty on my Ubuntu 12LTS box I get an output like this: testuser pts/0 Dec 9 02:32 . 2163 (host.xx.yy) running the same through cron I get: testuser pts/0 2012-12-09 02:32 00:05 2163... (2 Replies)
Discussion started by: latimer
2 Replies

3. UNIX for Advanced & Expert Users

SSH public key failing without error message

My password-free ssh connection has worked in the past but has stopped working and I can't get it going again. The files in .ssh on both source and target are set to 600: drwx------ 2 ingres 1024 Mar 2 13:57 . drwxr-xr-x 25 ingres 2048 Mar 29 09:38 .. -rw------- 1 ingres ... (9 Replies)
Discussion started by: Catullus
9 Replies

4. Shell Programming and Scripting

ssh run script error

Hello when try to excute the following ssh -l pla 10.287.60.55 vis_fil vis_fil not found. but it works fine when login to the server. can you help me run this command in one online because i will add later to shell script regards (1 Reply)
Discussion started by: mogabr
1 Replies

5. Shell Programming and Scripting

ssh - run shell script - Error

Hi Team, I am trying to run shell script from one server to another server with below command. ssh abc@pqr.america.com /tmp/test.ksh But, it gives below error. Can someone help me what is the issue? exec(): 0509-036 Cannot load program ssh because of the following errors: ... (3 Replies)
Discussion started by: ace_friends22
3 Replies

6. Solaris

Shell Script gives error when run through cron job.

Hi, The following shell script runs without any problem when executed manulally. USED=$(df -h /arch | tail -1 | awk '{print $5}' | cut -d '%' -f 1) if then find /arch/AUBUAT/ -type f -mtime +0 | xargs rm find /arch/AUBMIG/ -type f -mtime +0 | xargs rm fi But the same gives below... (6 Replies)
Discussion started by: ksadiq79
6 Replies

7. UNIX for Dummies Questions & Answers

Can't run the archiver executable error message

I am using the xarchiver on a xfce environment. When compressing a directory using xarchiver which has both files and subdirectories, I encounter the following error: Can't run the archiver executable: Failed to execute child process "tar" (Argument list too long) Does anyone know exactly what... (0 Replies)
Discussion started by: figaro
0 Replies

8. Shell Programming and Scripting

Cron job giving error while running SSH command

Hi All, The script which i am using to SSH to remote server is working fine when i run is using ./ but when cron runs it it gives error that "ssh: not found" please help!!! (3 Replies)
Discussion started by: visingha
3 Replies

9. UNIX for Dummies Questions & Answers

cron is already running message...

I am trying to schedule a new job but I get # cron # ! cron is already running Mon Jul 11 08:28:51 WAT 2005 ! ******* CRON ABORTED ******** Mon Jul 11 08:28:51 WAT 2005 I tried the -l and -e switches but I get the same message I am using HP-UX Thanks. (3 Replies)
Discussion started by: GNMIKE
3 Replies

10. UNIX for Dummies Questions & Answers

error message when trying to run prstat

I get the following error message when I tried to run prstat on my unix box: wolf@SLK1 10> prstat prstat: cannot find/execute "prstat" in ISA subdirectories *Basically I was trying to run a prstat on one box but I could see it didn't have the process so I copied it from another box and... (1 Reply)
Discussion started by: fusion99
1 Replies
Login or Register to Ask a Question