Weird Cronjob
9 posts
• Page 1 of 1
Weird Cronjob
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."
"God only created a few perfect heads ... the rest he covered with hair."
- adnanmadi
- Posts: 495
- Joined: Mon Mar 14, 2005 10:01 pm
- Location: Ramallah, Palestine
- Real Name: Adnan Madi
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."
"God only created a few perfect heads ... the rest he covered with hair."
- adnanmadi
- Posts: 495
- Joined: Mon Mar 14, 2005 10:01 pm
- Location: Ramallah, Palestine
- Real Name: Adnan Madi
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.
*/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.
- Absolute-Zero
- PROfessional Member
- Posts: 2495
- Joined: Sat Jun 26, 2004 2:46 pm
- Location: Forever blowing bubbles...
- Real Name: Dan
Re: Weird Cronjob
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."
"God only created a few perfect heads ... the rest he covered with hair."
- adnanmadi
- Posts: 495
- Joined: Mon Mar 14, 2005 10:01 pm
- Location: Ramallah, Palestine
- Real Name: Adnan Madi
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?
Is it possible for you to upgrade the version of cron you are using?
- Absolute-Zero
- PROfessional Member
- Posts: 2495
- Joined: Sat Jun 26, 2004 2:46 pm
- Location: Forever blowing bubbles...
- Real Name: Dan
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
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."
"God only created a few perfect heads ... the rest he covered with hair."
- adnanmadi
- Posts: 495
- Joined: Mon Mar 14, 2005 10:01 pm
- Location: Ramallah, Palestine
- Real Name: Adnan Madi
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...
It is, indeed, rather odd that the output file is being created correctly but the files seem to be being moved at different times...
- Absolute-Zero
- PROfessional Member
- Posts: 2495
- Joined: Sat Jun 26, 2004 2:46 pm
- Location: Forever blowing bubbles...
- Real Name: Dan
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.
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."
"God only created a few perfect heads ... the rest he covered with hair."
- adnanmadi
- Posts: 495
- Joined: Mon Mar 14, 2005 10:01 pm
- Location: Ramallah, Palestine
- Real Name: Adnan Madi
9 posts
• Page 1 of 1
Return to Other Operating Systems
Who is online
Users browsing this forum: No registered users and 0 guests