• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 836
  • Last Modified:

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
0
amarks_ny
Asked:
amarks_ny
  • 3
  • 3
1 Solution
 
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
 
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
amarks_nyAuthor Commented:
Ok, is my syntax correct?
0
 
MikeOM_DBACommented:
Yes crontab syntax seems to be 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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now