09-26-2019
How to end script in a cron job?
I've created a script to copy backup files from an HP-UX 11iv3 system to an NFS share on another machine. I want to schedule the script to run via cron. The script is simply three lines of cp /backups/Backup /shared/Backup. I've saved the script as a .sh file and call it with KSH. Do I need to include an end or exit command at the end of the script to ensure it exits cleanly?
Thanks,
Joe
Last edited by Peasant; 09-27-2019 at 01:01 AM..
Reason: Added icode tags.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
Needs your help in scheduling a cron job for the below mentioned requirement. Just let me know if anybody has a similar job running as mentioned below:
Month end reports - Report of all items created in a parent table that were created during the week.
Presently this report runs... (3 Replies)
Discussion started by: Bhups
3 Replies
2. UNIX for Advanced & Expert Users
Although there are many threads on this forum regarding cron, none have specifically answered my question. So hopefully someone can shed some light on what I'm doing wrong..
I have a perl script that I want to run in a cron job. Since I've read that cron doesn't have any environments set, I... (3 Replies)
Discussion started by: man
3 Replies
3. UNIX for Advanced & Expert Users
Hi, new to this forum and not sure if this is the right place to post. I'm new to cron jobs and scripts, and I need some help with a script to be used with a cron job. I already have a bot set up at a certain website address and need a script that the cron job will load every day that tells it to... (1 Reply)
Discussion started by: klawless
1 Replies
4. Shell Programming and Scripting
Greetings,
I am creating a ksh script to automate the installation of a utility on many servers.
As part of this install, I want to check for a job in root's crontab.
If the job exists, I need to comment it out.
I know I will need to copy off the crontab then read it back in, but I am... (4 Replies)
Discussion started by: 22blaze
4 Replies
5. Shell Programming and Scripting
Hey Guys,
i was trying out a shell script which has to remove a file for every 90 mins. this is the code i came up with .
$ crontab -e file1
file1 contains
30 1 * * * * rm -r /folder1/folder2/somefile.txt
Now i need the cron to run for every 90 mins. the problem with this is... (8 Replies)
Discussion started by: Irishboy24
8 Replies
6. Shell Programming and Scripting
Hi All,
I beginner in unix, i have no idea how to set the script file using cron job every 5 second. I also want to execute automatically the output to text file.This is my script name countsys.sh and my textfile abc.txt. (6 Replies)
Discussion started by: mastercar
6 Replies
7. Solaris
Hello,
How do I schedule a cron job for a phython script to run every hour?
Also, in case in future I decide to edit/cancel the job how should i do it?
Does it matter where my phython script is located? Also, I have am using mailx utility in my script to send me an email and dont want... (7 Replies)
Discussion started by: siddhans
7 Replies
8. UNIX for Dummies Questions & Answers
Hi guys,
How can I specify the start and end time of a cron job. And my start time and end time are specified by minutes. For example, I want to set up a cron runs every 3 minutes from 18:40 to midnight. How can i do this please? Many thanks
Best regards,
Clu (4 Replies)
Discussion started by: clu
4 Replies
9. UNIX for Dummies Questions & Answers
Hi Team,
When i am running the below query manually it is giving me the right output
i.e.
export PATH=/usr/sbin:/usr/bin:/sbin:/bin:$PATH
ADMIN=abc@abc.com
CPU_HIGH=`sar|awk '{print $9}'|sort -n|head -5|sed -n 5p`
CPU_MAX=`echo "scale=3; 100-$CPU_HIGH" | bc`
CPU_LOW=`sar|awk '{print... (13 Replies)
Discussion started by: Ekamjot
13 Replies
10. UNIX for Dummies Questions & Answers
I would like to run a script, as root, which will eventually set up cron job for a non privilege user. Please advice. (9 Replies)
Discussion started by: atanubanerji
9 Replies
LEARN ABOUT OSF1
uudemon.cleanu
uudemon(4) Kernel Interfaces Manual uudemon(4)
NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool
directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons
SYNOPSIS
These shell scripts reside in the following directory:
/usr/lib/uucp
DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove
the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file.
This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the
results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or
root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com-
mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This
script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour
script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script.
FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file.
RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1)
Files: /usr/lib/uucp delim off
uudemon(4)