- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Crontab query
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2010 11:02 PM
тАО03-15-2010 11:02 PM
Crontab query
Hi Folks
I have setup simple a job in root crontab to change permission on a file every 5 minutes forever but the cron doesn't execute the script successfully, I have tried with the below entries and refreshed cron but no difference.
*/5 * * * * /script.changowner > /outputfile 2>&1
and with
0-59/5 * * * * /script.changeonwer >outputfile 2>&1
Have i got the first entry incorrect in crontab ? and what would be the correct entry ?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2010 11:45 PM
тАО03-15-2010 11:45 PM
Re: Crontab query
So, your root account should have received email about each failed attempt. These emails might contain error messages or other clues about the failure reason.
You did not specify the name of the Linux distribution you're using, but assuming your distribution uses the Vixie Cron like most common distributions, your crontab line syntax seems OK.
However, have you really placed the script to the root directory (/) as your crontab lines seem to indicate? The recommended place to put locally-created sysadmin scripts would be /usr/local/sbin. Of course you can choose to ignore this recommendation if you have your reasons for it.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2010 01:38 AM
тАО03-16-2010 01:38 AM
Re: Crontab query
ls -lrt /script.changeonwer
does it have execute permission.
you may out it like
*/5 **** sh /script.changowner > /outputfile 2>/tmp/test
this test file would tell you the exact error and then u can move ahead to resolve the issue.
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2010 02:10 AM
тАО03-16-2010 02:10 AM
Re: Crontab query
Have you established a correct environment for the script you are using? Maybe your script fail to execute because of this.
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-16-2010 05:07 AM
тАО03-16-2010 05:07 AM
Re: Crontab query
> successfully [...]
What, exactly, does that mean?
ls -l /script.changeonwer
cat outputfile
> ls -lrt /script.changeonwer
"rt"? Why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2010 04:47 AM
тАО03-17-2010 04:47 AM
Re: Crontab query
Did you try adding the user in the cron command such as:
*/5 * * * * root /script.changowner > /outputfile 2>&1
RayB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-17-2010 06:36 AM
тАО03-17-2010 06:36 AM
Re: Crontab query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2010 08:39 AM
тАО03-18-2010 08:39 AM
Re: Crontab query
and make sure your file has execute permission for files.