Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1207
  • Last Modified:

can we pass parameter to crontab jobs?

Hi,

We want to pass a parameter to the script, which is scheduled as cron job. It looks like the parameter is not taken. Any suggestion? Thanks

45 06 * * 1-5 su - bgaaip -c sai_inventory_daily AAIP > sai_inventory_daily.log 2>&1
0
ebi168
Asked:
ebi168
1 Solution
 
tfewsterCommented:
Use double-quotes to enclose the command you are passing to 'su'
su - bgaaip -c "sai_inventory_daily AAIP"
0
 
ebi168Author Commented:
let me try it.
0
 
neteducationCommented:
if it's missinterpreted inside crontab then put your command into a script and start your script in your crontab.

Howevery what you do above does not make to much sense to me... why do you su from root to bgaaip and dont start the command directly in bgaaip's crontab ?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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