Sponsored Content
Top Forums UNIX for Dummies Questions & Answers CRON job to execute all scripts in a directory Post 302123021 by Annorax on Friday 22nd of June 2007 12:53:56 PM
Old 06-22-2007
Thank you all for the help. Not all of the files in the script directory are scripts, so the first script would probably suit me better.

Please forgive my "newbie-ness", but let me just double check things:

1.) I have a text file scriptCron.txt with this in it:

* 7 * * 5 /home/oracle/executeScripts.sh

2.) I have the executeScripts.sh file chmod'd to 777 and containing this:

#!/bin/ksh
cd /home/oracle/scripts
list=`ls *.ksh`
for script in $list
do
$script
done

3.) All I need to do is "crontab scriptCron.txt" and then it should be added to the crontab list.

And that should be it.

Does the user have to be logged in for the CRON jobs to run or will it run automatically?

Thanks again for the help. Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cron job -- to execute at every first Sunday of every month

Dear all How can I schedule the cronjob to be run sometime at every first Sunday at every month? I have the edit the cronjob every month now, thanks (2 Replies)
Discussion started by: shanemcmahon
2 Replies

2. UNIX for Dummies Questions & Answers

a cron job needs a perl script to execute

Hello evreyone, this is my first post, and to say i'm new to this is an understatement. I know very little about perl scripts and hope some one can help me. i'm looking to get a script that a cron job can execute. what the script needs to to is 1) connect to a mysql database 2) go to a... (2 Replies)
Discussion started by: Exader
2 Replies

3. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

4. Shell Programming and Scripting

Cron job to move file from one directory to another

Hi, I have following directory structure Media (Inside media directory I have two folders namely videos and images) -->videos -->images Inside media directory I have some video files with extension .mp4 and images with extension of .jpg and .jpeg I want to write a cron job which will... (3 Replies)
Discussion started by: tusharkale
3 Replies

5. Shell Programming and Scripting

cron job is not working for two scripts

Hi Gurus, I have a test unix server in which currently some unix cronjob are running. I have written two script one is a shell script in which env variable are there (in that i am exporting those variables). I have also written a perl script . when i am running at the shell manually like... (5 Replies)
Discussion started by: sanjay.login
5 Replies

6. UNIX for Dummies Questions & Answers

Executing python scripts via cron job

Hi, I'm executing a python script via cron job. The way it is set up is, I'm editing a file called local00 22 * * * root su - -c "/opt/setup_dir/bin/run_bkp -p" When this job executes, the command-specific logfile and the syslog (where the logs are supposed to go) show half of the logs(no... (2 Replies)
Discussion started by: ashwini.engr07
2 Replies

7. Shell Programming and Scripting

Adding a cron job that will execute everyday at 14:50 hrs

Hi I want to execute a cron job everyday at 14:50 hrs. I have a script like this: TMP_FILE="/tmp/tmpcron.txt" RES=0 /usr/bin/crontab -l >> $TMP_FILE ADD_JOB="50 14 * * * /opt/mypath/scriptname.sh" grep "scriptname.sh" $TMP_FILE >> /dev/null JOB_NOT_EXIST=$? if test $JOB_NOT_EXIST... (2 Replies)
Discussion started by: saurabhkoar
2 Replies

8. Shell Programming and Scripting

Cron Job failure - No such file or directory

Hi all, I'm having an issue with a script i wrote to pull information from the Amazon AWS API. Basically the script takes arguments from the command line and attempts to grab user information for each AWS access group. The command is issued like this: # sh awsReport.sh <outputFileName>... (3 Replies)
Discussion started by: ChocoTaco
3 Replies

9. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

10. UNIX for Beginners Questions & Answers

Is there a way to restrict a user (owner) to execute scripts from a specific directory

Hello, I have a user Bob on a RHEL 7 server1. Where his script area is "/home/Bob/scripts/" and he is the owner for this directory. On the server1, there is a NFS mount from another server2, with path as "/global/work/" and Bob is the owner for this directory too in server2. (Same UID and GID... (5 Replies)
Discussion started by: karumudi7
5 Replies
2004-04-15

      mailping

      0.0.4

MAILPING-CRON(1)						     Mailping							  MAILPING-CRON(1)

NAME
mailping-cron - run periodic processing to test email service availability and functioning SYNOPSIS
mailping-cron DESCRIPTION
mailping-cron processes incoming emails, updates status and sends out probe messages. The idea is to configure multiple email "circuits", send probe messages regularly, and see whether they complete the circuit and how long it took. Setting up a circuit 1. Give a name to the circuit, hereafter referred to as circuit. 2. Arrange for a local email address to be delivered to maildir /var/lib/mailping/state/circuit/incoming/. See mailping-store. 3. Create a configuration for the circuit, by creating directory /etc/mailping/circuit. If you need non-default sender and/or recipient addresses, create files from and to there, containing the sender and recipient addresses suitable for the circuit. 4. You're done! Munin should now see the data. Testing multiple servers To test functioning of more than one email server, arrange an email alias at a remote site pointing to an address on your server, and set the address of that alias here. Here's an example of testing a system consisting of two email servers and everything in that path (smarthosts, primary MXs, virus checkers, etc.): Local address <mailping+that@this.example.com> is delivered with mailping-store to /var/lib/mailping/state/that/incoming/. Remote address <echo@that.example.com> is an alias that redirects all email to <mailping+that@this.example.com>. /etc/mailping/that/to is set to <echo@that.example.com>. FILES
/etc/mailping/circuit/from Sender address for the probe emails. Default: <currentuserid@fullyqualifiedhostname>. /etc/mailping/circuit/to Recipient address for the probe emails. You must arrange for the email to eventually get delivered to the maildir /var/lib/mailping/state/circuit/incoming/. mailping-store will probably be useful in that. Default: <currentuserid+circuit@fullyqualifiedhostname> /etc/mailping/circuit/admin Admistrative address, set as Reply-To in probe messages. Default: do not add Reply-To. /etc/mailping/circuit/interval How often a probe message is sent, in seconds. Default: 600 seconds. /var/lib/mailping/state/circuit/ Stored state for the probing. /var/lib/mailping/state/circuit/junk/ Maildir used to store all messages in incoming that do not look like probe messages. Read and delete them regularly. /var/lib/mailping/state/circuit/broken/ Maildir used to store all messages in incoming that do look like probe messages, but a corresponding pending entry cannot be found. Duplicated probe messages cause these. Read and delete them regularly. ENVIRONMENT
MAILPING_CONFIGDIR Override the location of the configuration directory. Default: /etc/mailping MAILPING_STATEDIR Override the location of the state directory. Circuit states are stored in the state subdirectory of this directory, in subdirectories named after the circuit name. Default: /var/lib/mailping SEE ALSO
mailping-store(1), mailping-success(1), mailping-latency(1) AUTHOR
Tommi Virtanen <tv@havoc.fi> Havoc Consulting Author. COPYRIGHT
Copyright (C) 2004 Havoc Consulting mailping 0. 2004-04-15 MAILPING-CRON(1)
All times are GMT -4. The time now is 09:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy