LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-28-2013, 05:32 PM   #1
rjb2013
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Rep: Reputation: Disabled
cron issue


Hello!

First a bit of background - I am a field service engineer and have a bit of a problem with a bit of kit. I am pretty au fait with windows and dos but linux is something I have very little experience with.

This bit of kit should do a daily backup to a tape drive at 1:00am and give either a success or failure message but the task appears not to be running.
I have been advised to delete the FIFO file and restart the cron service which I have done with no effect.

In crontab the task is listed as:
0 1 * * 0-6 /usr/bin/csh -c '/opt/path/bin/daily_backup -x'
For my own interest can someone explain this line to me - I understand the first bit is setting when the task is to be run and the last bit is the path to the script to be run, but what's the bit in the middle? and what do the -c and -x do?

If I navigate to /opt/path/bin, I can run daily_backup -x sucessfully, so I guess the script is OK.

Any tips on what I can do next?

Cheers,
Rob.
 
Old 11-28-2013, 05:57 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
man csh =>
Code:
CSH(1)                           BSD General Commands Manual                           CSH(1)

NAME
     csh — a shell (command interpreter) with C-like syntax
...
     -c     Commands are read from the (single) following argument which must be present.
            Any remaining arguments are placed in argv.
.. so it just runs '/opt/path/bin/daily_backup -x' explicitly under the C shell at 1 AM every day of the week.

-x does whatever -x means to "daily_backup" .. we don't and can't know what.

Anything in the system or cron log?
 
Old 11-28-2013, 09:52 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Can you post the content of the script?

Also, try amending to
Code:
0 1 * * 0-6 /usr/bin/csh -c '/opt/path/bin/daily_backup -x' >/tmp/daily_backup.log 2>&1
and then look in the log file after a run.
While you're testing you may be able to change the time temporarily so you don't have to wait.
You'll have ask the system owner and/or check the script.
 
Old 11-29-2013, 02:02 AM   #4
rjb2013
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the replies guys.

It'll be mid next week before I can get back into the customers, so you'll have to stick with me.

Alucard: I'll check the logs

Chris: I assume amending that line creates some kind of txt log in the tmp directory? Would more daily_backup work to view the contents of the script?

Thanks
Rob.
 
Old 11-29-2013, 04:27 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Yep, of course
If its fairly small, you could just do 'cat daily_backup'.

Similarly for the log file.

Last edited by chrism01; 11-29-2013 at 04:29 AM.
 
Old 12-01-2013, 03:14 PM   #6
rjb2013
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the help so far guys.

Now I've started doing a little digging I've found some interesting info...

The crontab listed several processes (mostly report generation) that the unit should be doing on a daily and monthly basis, as well as the daily backup that I was concered about. When I questioned our helpdesk it would seem that they have not been seeing these reports being sent back to them...

I have asked them if they are seeing any of the tasks listed in the crontab but all of a sudden it has gone very quiet (they are supposed to make remote adjustments based on these reports ), so I'm assuming none of the tasks are being executed.

I'm guessing cron isn't running in this case (if none of the tasks are executing) - the commands I was given to restart it were:
Login as root
Navigate to /etc/cron.d
Remove file ‘FIFO’ by typing: rm FIFO
Start cron by typing: cron start


Do this look correct and how can I check cron is running OK?
 
Old 12-02-2013, 05:20 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
1. list all the entries in the cron file

2. post the scripts contents if they're not too big... possibly just choose one & lets just try to fix that one first, that'll probably tell you how to fix the others.

3. what distro are you running; try
Code:
cat /etc/*release*
and post the result.

4. normally crond is a system service and always running, so the advice you've been given sounds odd.
The cmd for restarting it will depend on the answer to qn 3.

HTH
 
  


Reply


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
cron issue with variables misterjones Linux - Server 7 11-26-2013 05:36 PM
Cron issue jameshurrell Linux - General 4 10-23-2012 04:54 PM
[SOLVED] cron issue dushyantgohil Linux - Server 9 10-04-2012 06:55 AM
cron issue props666999 Debian 1 08-31-2007 12:35 PM
cron issue abdul_zu Linux - Newbie 8 08-01-2005 12:39 AM


All times are GMT -5. The time now is 03:49 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration