?
Solved

More Crontab Help

Posted on 2006-05-18
11
Medium Priority
?
284 Views
Last Modified: 2013-12-16
Ok...

     This has been going on for way tooooooooooooooooooooo looooooong and I never get the answer right and there are always issues and I don't understand why.  Here is a few settings from my crontab.  

2 20 * * * cd /mnt/logs/ && /usr/bin/unzip /mnt/logs/domain/BOBapp`date +\%m-\%d-\%Y`*
4 20 * * * cd /mnt/logs/ && /usr/bin/unzip /mnt/logs/domain/BOBsys`date +\%m-\%d-\%Y`*
6 20 * * * cd /mnt/logs/ && /usr/bin/unzip /mnt/logs/domain/BOBsec`date +\%m-\%d-\%Y`*
2 21 * * * cd /mnt/logs/ && /bin/mv /mnt/logs/BOBapp`date +\%m-\%d-\%Y`@15-0?-??.txt /home/somewhere/fetch/app`date +\%m-\%d-\%y`.txt
4 21 * * * cd /mnt/logs/ && /bin/mv /mnt/logs/BOBsys`date +\%m-\%d-\%Y`@15-0?-??.txt /home/somewhere/fetch/app`date +\%m-\%d-\%y`.txt
6 21 * * * cd /mnt/logs/ && /bin/mv /mnt/logs/BOBsec`date +\%m-\%d-\%Y`@15-0?-??.txt /home/somewhere/fetch/app`date +\%m-\%d-\%y`.txt

Ignore the fact the time is unusual.  I have my reasons.  The BOBapp seemed to work last night, but the BOBsys and BOBsec didn't seem to work.  I am trying to find out why.  The only change is that I did have unzip times going one minute after another.  Is that too soon?  I perform tests by checking to make sure everything works in the command line.  I perform tests by changing the times in crontab.  Everything seems to work out.  When it comes time to run everything, it just doesn't seem to work.  I am a linux beginner.  I don't really know how to read the var/log/mail root.  I can only read them one at a time.  What app does one use to read that file properly.  This is a case where I am going to wait until I run this stuff overnight to hand out points as every time things seem to work, nothing works after I make changes.  I am offering 500 points however as I am manipulating these files by the command line and not through cron which means I am spending way too much time on these files and I am genuinely interested in doing this properly.  Also I am interested in setting up a perl application to run via command line.  Any tricks I should be wary of?
0
Comment
Question by:awakenings
  • 6
  • 4
11 Comments
 

Author Comment

by:awakenings
ID: 16708762
Side notes...

1 I am using Suse 10.0
2  The ` is correct for the date function.  Trust me.
3 The date function is set up properly.  I've tested via command line.
0
 
LVL 19

Assisted Solution

by:jools
jools earned 1800 total points
ID: 16710760
Hello again! :-)

Have you checked the mail account (possibly root) to see if there are any errors?
Just type `mail` at the command prompt or if you have a local email account, edit /etc/aliases and change the entry for root to point to your userid though this is probably going off the thread a little it may help you find out whats going on.

If you look at root's mail by typing `mail` just press enter to look at the messages, it's not the best mail client!

J

0
 
LVL 19

Accepted Solution

by:
jools earned 1800 total points
ID: 16710776
You should be able to check the logs now, I'm online for a while and it may be something we can get going before you night run kicks in depending on your TZ!

FYI, I don't believe that kisking off a number of jobs at the same time would be a problem unless you're trying to read/write to the same file(s).

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Assisted Solution

by:jools
jools earned 1800 total points
ID: 16710807
On the mail front, my /etc/aliases looks like;
     # Person who should get root's mail
     root:           jpar

I then just use my own mail client on my MS PC to read all the email! Handy for logwatch stuff and all the other bits.

0
 
LVL 19

Assisted Solution

by:jools
jools earned 1800 total points
ID: 16711745
1 more thing, do the other files (the ones that failed) exist on the system?

Posting the results from the email would help diagnose.....OK, thats 2 more things! ;-)
0
 

Author Comment

by:awakenings
ID: 16712954
Hey folks,

    Today was supposed to be an easy, quick, simple day and I was going to look at this stuff sooner.  Sorry for the delay.

     I typed in mail.  It has stuff from months ago and doesn't seem to have anything recent.  It then goes into path, etc.  I don't follow the rest of it.

     I looked around the system and didn't see anything else.  Any more suggestions for email?

Thanks!

Awakenings
0
 

Author Comment

by:awakenings
ID: 16712956
Oh... It is just folk... hahaha
0
 
LVL 19

Assisted Solution

by:jools
jools earned 1800 total points
ID: 16713474
just try `more /var/spool/mail/root` instead...
0
 

Author Comment

by:awakenings
ID: 16721220
Ok...  I am dumb.  I fixed the issue.  I'll give ya points though.  The perl I'll test when I have time.
0
 
LVL 19

Expert Comment

by:jools
ID: 16721733
Hey, we've all been there...seen it, done it, got the t-Shirt etc etc


Cheers

J
0
 
LVL 3

Assisted Solution

by:bryanlloydharris
bryanlloydharris earned 200 total points
ID: 16802988
Why not put your full commands into a bash script and then:

2 20 * * * /path/to/script
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question