Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Crontab Issue

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-05-2005   -   Original Discussion by rickyt00
rickyt00's Unix or Linux Image
rickyt00 rickyt00 is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 20 March 2006, 1:48 PM EST
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Crontab Issue

I have a backup script that is suppose to run every night of the week, but it never does, it starts to run. The way I can tell is that the dates on dump_log are changing to when the script runs. If I look in the cron log file is shows
! > root 506342 cr /etc/back_up Fri Aug 5 10:30:00 2005
! < root 506342 cr /etc/back_up rc=2 Fri Aug 5 10:30:00 2005

I have not been able to find anything except if cron exits with 0 it was successful and if >0 it was unsuccessful. Also if I just run the script manually ./etc/back_up it works fine. Any thoughts? Thanks
Sponsored Links
    #2  
Old Unix and Linux 08-05-2005   -   Original Discussion by rickyt00
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 13 December 2017, 6:33 PM EST
Location: NM
Posts: 11,249
Thanks: 577
Thanked 1,121 Times in 1,033 Posts
cron scripts do not have much of an environment - PATH etc may not be defined.


Assume that all references to things like "echo", if they are not shell builtins, must have a path - "/usr/bin/echo" or whatever. Plus, you have to shebang (#!/bin/ksh) on the first line of the script to get the shell you want - korn, etc. Otherwise you will get sh, your system's version of the Bourne shell.
Sponsored Links
    #3  
Old Unix and Linux 08-06-2005   -   Original Discussion by rickyt00
rickyt00's Unix or Linux Image
rickyt00 rickyt00 is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 20 March 2006, 1:48 PM EST
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
I looked at the env. and it seems to me that every thing is in the PATH, This is a new box, and I checked out the old box and everything seems to be the same. Here is the path and the script, It does work fine if you run it manually. It seems like it is choking on the /sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk0a >>&/etc/dump_log because first it never writes to the file and if I do a ps -ef | grep dump after the scheduled time nothing shows up.


PATH=/sbin:/usr/sbin:/usr/bin:/usr/bin/X11:/admin/wp51/wpbin/:/admin/wp51/shbin:/usr/ud/bin:/usr/local:/usr/udms:/usr/udms/etc




#! /bin/csh
# /etc/back_up 7-25-05
# Use restore -ivf /dev/tape/tape0_db0 -s x (x = volume to be restored from)
# for file by file restores.
# Remember to rewind tape between restores when restoring different
# filesystems(volumes).
# Also, check fs using df to make sure tape does not fill up.
# Check /etc/backup_date for start and stop times and
# /etc/dump_log for play by play dump status info
#
echo > /etc/backup_date
echo > /etc/dump_log
#
echo starting full backup at `date` >> /etc/backup_date
#
#
echo starting dump of: / filesystem at `date` >> /etc/backup_date
/sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk0a >>&/etc/dump_log
echo dump of: / finished at `date` >> /etc/backup_date
#
echo starting dump of: /usr filesystem `date` >> /etc/backup_date
/sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk0g >>&/etc/dump_log
echo dump of: /usr finished at `date` >> /etc/backup_date
#
echo starting dump of: /db1 filesystem `date` >> /etc/backup_date
/sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk1b >>&/etc/dump_log
echo dump of: /db1 finished at `date` >> /etc/backup_date
#
echo starting dump of: /db2 filesystem `date` >> /etc/backup_date
/sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk2b >>&/etc/dump_log
echo dump of: /db2 finished at `date` >> /etc/backup_date
#
echo starting dump of: /db3 filesystem `date` >> /etc/backup_date
/sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk3b >>&/etc/dump_log
echo dump of: /db3 finished at `date` >> /etc/backup_date
#
echo starting dump of: /unidata filesystem `date` >> /etc/backup_date
/sbin/dump 0fsu /dev/ntape/tape0 1000000 /dev/disk/dsk4b >>&/etc/dump_log
echo dump of: /unidata finished at `date` >> /etc/backup_date
#
# Notify sytems administrators
mailx -s "dump done: admin4" admin@admin.com < /etc/dumpdates
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab Issue..!!! gayisada UNIX for Dummies Questions & Answers 1 05-02-2011 06:55 AM
Crontab issue h@foorsa.biz AIX 3 05-02-2011 04:55 AM
crontab issue crackthehit007 UNIX for Advanced & Expert Users 4 03-23-2009 12:32 AM
crontab issue vaddi HP-UX 11 01-28-2008 06:07 AM
crontab issue Semper_Tempus Solaris 6 07-19-2005 11:13 PM



All times are GMT -4. The time now is 10:15 PM.