Cron Tabs Variable with OSX 10.6.4 server

I am trying to set up a cron job on OSX Server. I need to running this script at 5 am to run an import on 4 watched folders.  i need to trigger this 4 times with a different command

such as ./myimportscript2Xml.sh co

Import script
00     5       *       *       * /usr/local/scripts/myimportscript2Xml.sh



so is this correct or should I specify the full path of the script.

Import script
00     5       *       *       * /usr/local/scripts/myimportscript2Xml.sh "co"

o
amarks_nyAsked:
Who is Participating?
 
MikeOM_DBAConnect With a Mentor Commented:
Yes crontab syntax seems to be correct
0
 
MikeOM_DBACommented:

Insufficient information.
Please define "trigger this 4 times with a different command" and "should I specify the full path of the script" .
0
 
amarks_nyAuthor Commented:
would my crontab be this?

my variables are co, br, mx, and ar.


Import script
00     5       *       *       * /usr/local/scripts/myimportscript2Xml.sh "co"

00     5       *       *       * /usr/local/scripts/myimportscript2Xml.sh "br"

00     5       *       *       * /usr/local/scripts/myimportscript2Xml.sh "mx"

00     5       *       *       * /usr/local/scripts/myimportscript2Xml.sh "ar"
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
nxnwCommented:
Don't use cron at all, which is deprecated in OS X. Use launchd, which is more powerful and can be configured with a GUI application named lingon.
0
 
amarks_nyAuthor Commented:
Ok, is my syntax correct?
0
 
MikeOM_DBACommented:
Now, you could also code one scripts to do all:
Crontab entry:
00     5       *       *       * /usr/local/scripts/myimportscript0Xml.sh
Script:

#!/bin/ksh
for v in co br mx ar
do
  /usr/local/scripts/myimportscript2Xml.sh $v
done

Open in new window

0
 
amarks_nyAuthor Commented:
Yes, I suggested doing that as one script,

I was overruled in this instance.

Thank you for the input.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.