|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Crontab Job Output File
I am a newbie to Unix. My default root user umask is set to 077 and I have the following crontab job to redirect al the backup output to the logfile of /backup/backup.xxxxx Code:
00 10 * * 0 /usr/local/bin/backup.sh > /backup/backup.`date +\%Y\%m\%d` 2>&1 Since root default umask is 077, the backup logfile of /backup/backup.xxxx is only readable to root itself. But I want to allow non-root or normal account to be able to read the backup logfile. Is there a way to achieve this in the crontab syntax itself? Last edited by Franklin52; 01-08-2013 at 02:45 AM.. Reason: Please use code tags for data and code samples |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Why can't you give the right permission to the back up file when logged in as Root.
|
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
If you do not like to do it manually you can add a chmod line in crontab Code:
00 15 * * 0 chmod 644 /backup/backup.`date +\%Y\%m\%d` or just do it after your command Code:
00 10 * * 0 /usr/local/bin/backup.sh > /backup/backup.`date +\%Y\%m\%d` 2>&1 ; chmod 644 /backup/backup.`date +\%Y\%m\%d`
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Script to grep Job File name and Log File name from crontab -l | guptra | Shell Programming and Scripting | 1 | 09-08-2012 12:10 AM |
| output file of the shell script running through crontab is deleting automatical daily. | innamuri.ravi | Shell Programming and Scripting | 2 | 10-14-2009 01:08 AM |
| Crontab keeps saving empty files of the job file. | iarp | UNIX for Dummies Questions & Answers | 3 | 10-20-2008 06:47 PM |
| Help with a crontab job!!! | kumarsaravana_s | Shell Programming and Scripting | 4 | 03-28-2007 04:02 AM |
| crontab job | Moe | UNIX for Dummies Questions & Answers | 3 | 11-02-2005 04:17 PM |
|
|