A Digital Age Deserves A Digital Leader

Weird Cronjob

Weird Cronjob

Postby adnanmadi » Wed Nov 21, 2007 4:13 am

:-? Hello Guys,

I have set up this cronjob

0,5,10,15,20,25,30,35,40,45,50,55 * * * * (mv /some/path/* /other/path/ > output.txt)

the weird thing is: the files are moved every certain amount of seconds not every 5 minutes. but the output file is created in the correct time i.e. each 5 minutes.

any ideas?

something else, I tried to use */5 instead of mentioning the minutes but it didn't work "is this specific to certain UNIX platforms?" I am using Solaris

thanks
<img src='http://img118.imageshack.us/img118/9747/adnanmadisigblurfinalix7.jpg' border='0'>
"God only created a few perfect heads ... the rest he covered with hair."
PRO Level 11
User avatar
Posts: 495
Joined: Mon Mar 14, 2005 10:01 pm
Location: Ramallah, Palestine
Real Name: Adnan Madi

Postby gries818 » Thu Nov 22, 2007 4:36 am

Sorry man, my knowledge of the deep unix stuff is very limited.

Good luck though
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby adnanmadi » Thu Nov 22, 2007 7:33 am

thanks for the try my friend, I don't have high expectations that other people can help because this forum is becoming inactive, I hope that me and you will make it a live forum ;)
<img src='http://img118.imageshack.us/img118/9747/adnanmadisigblurfinalix7.jpg' border='0'>
"God only created a few perfect heads ... the rest he covered with hair."
PRO Level 11
User avatar
Posts: 495
Joined: Mon Mar 14, 2005 10:01 pm
Location: Ramallah, Palestine
Real Name: Adnan Madi

Postby Absolute-Zero » Thu Nov 22, 2007 11:10 am

Have you tried simplifying the cron syntax? You can specify five minute interval in (some version of)cron by using the following...

*/5 * * * *

...and you could also put the command you want to execute into a script then have cron run the following...

*/5 * * * * movefiles.sh

Just an idea.
Image
PROfessional Member
User avatar
Posts: 2495
Joined: Sat Jun 26, 2004 2:46 pm
Location: Forever blowing bubbles...
Real Name: Dan

Re: Weird Cronjob

Postby adnanmadi » Thu Nov 22, 2007 3:26 pm

Happy Hammer wrote:Have you tried simplifying the cron syntax? You can specify five minute interval in (some version of)cron by using the following...

*/5 * * * *

...and you could also put the command you want to execute into a script then have cron run the following...

*/5 * * * * movefiles.sh

Just an idea.

adnanmadi wrote:something else, I tried to use */5 instead of mentioning the minutes but it didn't work "is this specific to certain UNIX platforms?" I am using Solaris


I will try the script thing, maybe a workaround will work
thanks Dan
<img src='http://img118.imageshack.us/img118/9747/adnanmadisigblurfinalix7.jpg' border='0'>
"God only created a few perfect heads ... the rest he covered with hair."
PRO Level 11
User avatar
Posts: 495
Joined: Mon Mar 14, 2005 10:01 pm
Location: Ramallah, Palestine
Real Name: Adnan Madi

Postby Absolute-Zero » Thu Nov 22, 2007 3:35 pm

Sorry Adnan, missed the bit about */5 in your post. Yes, it appears some version of cron don't support that particular format.

Is it possible for you to upgrade the version of cron you are using?
Image
PROfessional Member
User avatar
Posts: 2495
Joined: Sat Jun 26, 2004 2:46 pm
Location: Forever blowing bubbles...
Real Name: Dan

Postby adnanmadi » Thu Nov 22, 2007 3:41 pm

it is ok man,
I am not the owner of the server it is for a client and I have no control of it so I think I will live without simplicity for sometime ;)

thanks anyway, will try tomorrow the script and I will update you
<img src='http://img118.imageshack.us/img118/9747/adnanmadisigblurfinalix7.jpg' border='0'>
"God only created a few perfect heads ... the rest he covered with hair."
PRO Level 11
User avatar
Posts: 495
Joined: Mon Mar 14, 2005 10:01 pm
Location: Ramallah, Palestine
Real Name: Adnan Madi

Postby Absolute-Zero » Thu Nov 22, 2007 3:52 pm

There's no particular reason for upgrading cron except that a later Solaris version may support the */ interval syntax.

It is, indeed, rather odd that the output file is being created correctly but the files seem to be being moved at different times...
Image
PROfessional Member
User avatar
Posts: 2495
Joined: Sat Jun 26, 2004 2:46 pm
Location: Forever blowing bubbles...
Real Name: Dan

Postby adnanmadi » Mon Nov 26, 2007 4:48 am

well, suddenly my cron job is working properly :) I think someone was doing the same thing when I was testing my cronjob.

thanks a lot Dan.
<img src='http://img118.imageshack.us/img118/9747/adnanmadisigblurfinalix7.jpg' border='0'>
"God only created a few perfect heads ... the rest he covered with hair."
PRO Level 11
User avatar
Posts: 495
Joined: Mon Mar 14, 2005 10:01 pm
Location: Ramallah, Palestine
Real Name: Adnan Madi

Return to Other Operating Systems

Who is online

Users browsing this forum: No registered users and 0 guests

cron
cron