LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
Search this Thread
Old 03-20-2012, 01:04 AM   #1
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 26

Rep: Reputation: Disabled
Arrow CRON not working ; any other way to schedule a script ?


Hi,

I'm using AIX Version 6.1

I had setup a CRON to run a particular script daily at 23:05, but unfortunately its not running from CRON.

Is there any other way to schedule a script to run daily at 23:05 (System Time) like using an indefinite loop and sleep command in existing script and running it in background ?

If yes, can you please provide me the code snipet of the same as I am unable to figure out what exactly needs to be put in.

Looking forward to a quick response.

Thanks in advance.
 
Old 03-20-2012, 01:55 AM   #2
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 166

Rep: Reputation: 8
How are you scheduling job in cron ?
Can you shouw the output of #crontab -e.
 
Old 03-20-2012, 01:58 AM   #3
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

I'd look first into why cron isn't working for your script. Are the permissions on the script set correctly? Are you using full path to your script in the cron definition? Does your script work if executed manually as the user intended to run the script? The best option to run a script automatically is by using cron in my opinion, so troubleshoot that first would be my advice.

Kind regards,

Eric
 
Old 03-20-2012, 02:05 AM   #4
jimtony
Member
 
Registered: Jan 2011
Location: Shanghai,China
Distribution: fedora
Posts: 73
Blog Entries: 1

Rep: Reputation: 2
How did you configure CRON?
Use crontab -e is OK.

* * * * * command
minute hour day month week

Last edited by jimtony; 03-20-2012 at 02:38 AM.
 
Old 03-20-2012, 02:28 AM   #5
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 26

Original Poster
Rep: Reputation: Disabled
This is the crontab -e entry : 5 23 * * * /var/mqm/tmp/pso/ftp_cron.sh

chmod 777 permission is given to the script.

I had raised a ticket with IBM & they said that there is some issue with OS & some patching needs to be done to overcome this.
So, basically CRON won't work, no matter what.

Hence, how do I schedule a job without using CRON ?
 
Old 03-20-2012, 02:36 AM   #6
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

Very strange that cron wouldn't work no matter what but if the guys from IBM said that...

You could look into the 'at' command to 'pre-program' a job to run. But you'll need to find a way (scripting for example) to automate it since that's not possible with standard 'at' command.

Kind regards,

Eric
 
Old 03-20-2012, 02:39 AM   #7
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 26

Original Poster
Rep: Reputation: Disabled
I'm fairly new to unix shell scripting.
Can you please provide me an example of the code you are suggesting ?
 
Old 03-20-2012, 02:53 AM   #8
jimtony
Member
 
Registered: Jan 2011
Location: Shanghai,China
Distribution: fedora
Posts: 73
Blog Entries: 1

Rep: Reputation: 2
Use "man at" command to see how to use at.
Or google at.
 
Old 03-20-2012, 03:25 AM   #9
Lexus45
Member
 
Registered: Jan 2010
Location: Kurgan, Russia
Distribution: Slackware, Ubuntu
Posts: 339
Blog Entries: 3

Rep: Reputation: 47
Have you tried running the script manually, without cron ?
 
Old 03-20-2012, 04:09 AM   #10
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 26

Original Poster
Rep: Reputation: Disabled
Yes, it is working perfectly when run manually.
There is a OS problem with CRON, as confirmed by IBM. So, there is no problem with the script or the CRON command as such.

Is there anyother way to schedule it by adding a loop or something in the script & running it in background ?
 
Old 03-20-2012, 06:32 AM   #11
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Quote:
Originally Posted by arjundey View Post
I'm fairly new to unix shell scripting.
Can you please provide me an example of the code you are suggesting ?
Hi,

No, I cannot provide a 'custom made' example since I don't use 'at' to plan tasks. You'll have to look at the manpage as suggested.

Kind regards,

Eric
 
Old 03-20-2012, 11:23 PM   #12
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 166

Rep: Reputation: 8
You can run a script at statup also by adding it in /etc/initab/.
If it suits your condition.
 
Old 03-21-2012, 01:32 AM   #13
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 26

Original Poster
Rep: Reputation: Disabled
@ac_kumar - Yes, that could be done, but basically I need it to run at 23:05 daily. How to do that ?
 
Old 03-21-2012, 01:55 AM   #14
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 166

Rep: Reputation: 8
Quote:
Originally Posted by arjundey View Post
@ac_kumar - Yes, that could be done, but basically I need it to run at 23:05 daily. How to do that ?
You can make a startup script which contains at commands to run:-

http://www.brunolinux.com/02-The_Ter...t_Command.html
 
Old 03-21-2012, 02:34 AM   #15
arjundey
LQ Newbie
 
Registered: Sep 2011
Posts: 26

Original Poster
Rep: Reputation: Disabled
This was indeed helpful ac_kumar. Thanks a ton !

This thread is now resolved.

Thanks all for your time & valuable inputs. Cheers !!!
 
  


Reply

Tags
cron, infinite, infiniteloops, loop


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shell Script Not Working in Cron 3rods Linux - Newbie 6 02-10-2010 08:24 PM
Cron Schedule Issue richinsc Linux - Server 3 03-01-2008 05:32 PM
what is cron schedule coldbeerz Linux - Newbie 5 12-05-2007 03:24 PM
LXer: Schedule Tasks Using Gnome-schedule (cron & at GUI) LXer Syndicated Linux News 0 07-28-2007 12:31 AM
How do I schedule a cron job? BillyGalbreath Debian 1 05-18-2006 09:52 PM


All times are GMT -5. The time now is 08:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration