CRON JOB not running - for tape backup from root user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting CRON JOB not running - for tape backup from root user
# 1  
Old 11-18-2014
CRON JOB not running - for tape backup from root user

I am trying a cron on root user to backup to tape using TAR command

here is the cron entry

Code:
11 08 * * 6 /erdhot1cron 2>&1 >> /test3/scripts/dba/erdhot1cron.log



here is script inside - edhot1cron
Code:
#!/bin/bash
vsysdt=`date +%d%m%y`
date
tar -cvf /dev/st0 backup1/spbl_backup/spblora_backup/*.* backup1/spbt_backup/spbtora_backup/*.* backup1/spbm_backup/spbmora_
backup/*.*
date

here is the cron log i have,
"
Code:
Sat Nov 15 08:11:01 IST 2014
Sat Nov 15 08:11:11 IST 2014

"

date command is alone running on cron and tar is not executing- am i not mentioning the correct path or env variable for tar

here is what i see in /bin with ls cmd ( only some files, i have copied here )

lrwxrwxrwx 1 root root 4 May 25 2002 sh -> bash
lrwxrwxrwx 1 root root 3 May 25 2002 gtar -> tar

do i need to add some path variable for cron to execute tar ... please advise

thanks,
Vijayaraghavan.K
# 2  
Old 11-18-2014
What cron log are you mentionning?, looks like your /test3/scripts/dba/erdhot1cron.log
havent you looked in the cron original log?
Q: Where do you expect cron to find?:
Code:
 backup1/spbl_backup/spblora_backup/*.*

Unless you have given to cron the correct environment, it needs abosolute path to all you mention...
# 3  
Old 11-19-2014
Thanks for mentioning it right.

I have got that running well on cron.

Thanks a lot
# 4  
Old 11-19-2014
How did you solve the problem?
# 5  
Old 11-22-2014
Hi

By just giving the full path from root - /

in my case this is the change , just adding / before the directory structure

tar -cvf /dev/st0 /backup1/spbl_backup/spblora_backup/*.* /backup1/spbt_backup/spbtora_backup/*.* /backup1/spbm_backup/spbmora_ backup/*.*
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Create cron job without root

Hi there, I need to create a crone job to backup certain files on my disk without root permissions. Also if I will be able to edit cronetab then I need to know how to edit it with any editor other than vim :mad: (5 Replies)
Discussion started by: aelhosiny
5 Replies

2. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

3. Shell Programming and Scripting

Does running a cron job of a user require the user to be logged in?

Suppose user 'asdf' is not logged into server 'bbbb', but the server is up. User 'asdf' has cron job. Will it be executed? (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

4. Solaris

Is user cron job running in background?

Hi, Should the user jobs specified in crontab be running in background? Cron daemon is already running in background. So I am not sure whether should the jobs (output and error messages are redirected to file) ran by it be explicitly stated to be run in background (& at end of command) if one... (1 Reply)
Discussion started by: joe_x
1 Replies

5. Shell Programming and Scripting

Cron job initiating ssh AND sudo (from user, not root)

I've been bashing my head on the desk for 2 days trying to get this to work, but I've had no luck. I'll try to be as clear as possible in my explanation without dragging out the details. I'm trying to set up a cron job for user "john" which runs a script. This script initiates an ssh connection to... (5 Replies)
Discussion started by: eh3civic
5 Replies

6. Shell Programming and Scripting

check mail backup cron job

i have just installed a cron job to run at 3 in the morning once a week. It's difficult for me to test if it works because the email backup program takes the email service down before running the backup. I wondered if i could ask you gurus if this would work? 0 3 * * 0 ... (1 Reply)
Discussion started by: timgolding
1 Replies

7. Shell Programming and Scripting

Adding a new root cron job

Hi there, I have over 2000 systems (mainly Solaris) and I want to write a script that inserts a new root cronjob on each of those servers. obviously just adding a line to /var/spool/cron/crontabs/root looks like the easiest way, but i really dont want to have to send a HUP to crond on all boxes ... (3 Replies)
Discussion started by: rethink
3 Replies

8. UNIX for Dummies Questions & Answers

Cron job not running

Hi All, I am editing crontab using -e option to add a new job Below is the line 30 * * * * scriptpath This job is not executing every thirty minutes. I have checked, cron daemon is running. What did I miss? Can some one help? I am using cron shell..ksh (7 Replies)
Discussion started by: yabhi_22
7 Replies

9. UNIX for Advanced & Expert Users

cron job is not running

hi, i have the following line in the crontab 15 5 * * 6 /home/adw/BCE_ADW.pl The problem is the cron job is not getting started automatically. But this was working til last week. now it is not working. what could be the problem. Any idea? (3 Replies)
Discussion started by: Suguna
3 Replies

10. Shell Programming and Scripting

Backup with shell program and cron job.

Hi, The object of my program is to take automatic backup on daily basis to different folders. I have created the respective folders. when I execute below given shell program manually it is working perfectly and taking the backup to respective folder. #!/bin/sh #script to take backup on... (1 Reply)
Discussion started by: jarkvarma
1 Replies
Login or Register to Ask a Question