I stopped using relative paths and find long time ago (unless doing interactive work).
This approach is much safer and easier to maintain :
This way, an error if directory does not exist or permission is denied is printed on stderr.
You will see this error in local mail if running in crontab (if no stderr redirection has been made inside crontab line).
Do not use trailing slashes with directory variables.
Example of things going haywire when doing that :
Decommission -> create a virtual machine out of it - if you can, not some obscure OS/hardware
Good things to do before decommission are (if you cannot virtualize it in lab) :
Copy all crontab and at entries and related scripts used in those.
Issue a mount, output into a file and copy it somewhere safe.
Issue a share into a file (if NFS or other network file systems are exported on the box).
FC and LAN topology should be written down (WWNS, lan port configuration etc.)
/etc/passwd, /etc/shadow, /etc/group, /etc/hosts (perhaps more depending) files should be copied.
All above is done in couple of minutes or less, and is golden for post mortem analysis.
Hope that helps
Regards
Peasant.
Last edited by rbatte1; 10-23-2017 at 07:34 AM..
Reason: Converted to formatted numbered list with LIST=1 tags
These 2 Users Gave Thanks to Peasant For This Post:
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... (2 Replies)
Hello
i have a shell script. it is running fine when i manually run at command prompt using following command
./script_file
but while running shell script from crontab, it is giving error in each line. (2 Replies)
Hi,
Could any one help me to extract data from a report.
I would like to get the two lines which are just below the separations
I have a report like this
--------------------------------------------------------------------------
Pid Command Inuse Pin Pgsp Virtual... (2 Replies)
I am adding a piece of code which adds entry in crontab ((in brown color))
\crontab -l > $tmpfile
echo "Removing the cleanProcess entry if it already existed.."
grep -v "cleanProcess.sh" $tmpfile > $newtmpfile
lcnt=`grep -c "cleanProcess.sh" $tmpfile`
echo... (4 Replies)
Executive summary:
Code (posted below) cores in AIX 5.3, despite being compiled and run successfully on several other operating systems. Code is attempting to verify that pthread_mutex_lock can be successfully aborted by siglongjmp. I do not believe this is an unreasonable requirement.
If... (1 Reply)
I am facing a strange issue while running a script(eg A) from the crontab entry
the script calls one more script(eg B) within it
now when i run the script A manually(with nohup) it also executes the script B (embedded inside it) as expected.
but when i run the script A from the crontab entry... (7 Replies)
Helo .
I have 2.6.13-1.1526_FC4smp here.
I am trying to make crontab execute my simple shell script, but noting happens.
here is how i am testing this :
$ pwd
/home/oracle
$ ls -l two*
ls: two*: No such file or directory
$
$ crontab -e
crontab: installing new crontab
$
$ crontab... (7 Replies)
Hi,
I was mucking around with Maven for Eclipse the other day, working on an audio visual project and I was struck by how cool the terminal executing massive amounts of commands is.
I have an odd request. I was wondering if people knew of a terminal script that outputed a lot of data,... (0 Replies)
hi,
i have schduled a job through crontab, but it is not getting executed.
bash-3.2$ crontab -l
# Monthly Download (mm hh DD MM format)
35 05 01 04 * /home/ftpsrp/srpftp1/download/ofrdb/scripts/load_ofrdb.sh crr.sh
here is the permission of the .sh files
-rwxr--r-- 1 ftpsrp srp ... (7 Replies)
I'm having a shell script which has to be run only once at the specified time.
Shell script is like following,
#!/bin/bash
db2 connect to XXX > connection_status.txt
This script is scheduled in crontab as following,
50 4 8 5 0 sh script.sh
scheduled script is run at the specified time... (1 Reply)