The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron not running garric UNIX for Advanced & Expert Users 6 04-11-2008 08:32 AM
Cron not running .. please help beisaikong Shell Programming and Scripting 2 07-12-2007 07:05 AM
cron job is not running Suguna UNIX for Advanced & Expert Users 3 09-28-2006 09:11 AM
not running in cron ajnabi UNIX for Advanced & Expert Users 4 07-11-2003 02:35 PM
Cron Sends mail to root on completion of job. skotapal UNIX for Dummies Questions & Answers 1 04-25-2003 04:27 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-02-2009
novice633 novice633 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 1
cron job not running to completion

am running a cron job to do a backup of all user files. the script runs properly in the terminal but only backups about 20% of the files when run by cron.

the Linux system is running BASH as far as I can tell.

the symbols $FILE and $DIRECTORY are defined properly and the following is the active line which causes the backup to occur:

NAME=userName;
#
DIRECTORY=~/$NAME;
FILE=$DIRECTORY/`date '+%y%m%d%H%M%S'`_$NAME.tar;
#
tar -cvf $FILE $DIRECTORY/html;

what do I need to do to get cron to create a tarball of all the files?
  #2 (permalink)  
Old 07-02-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,041
If you direct (as most people do) the stderr and stdout to /dev/null in the crontab file, remove this, then check your mail to see what, if any error you receive.

zum Beispiel:

0 0 * * * myJob > /dev/null 2>&1

(remove the "> /dev/null 2>&1" part)

i.e. standard ourput and standard error goes to the mailbox of the owner of the job (unless you throw it away to /dev/null). This is usually a good place to look for why the job did not finish as you expected.

---

by "check your mail" I mean (logged in as the user who starts the job) run "mail". You should see something like "cronjob .... produced the following output" (or some such)

Last edited by scottn; 07-02-2009 at 06:52 PM..
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0