Hi ,
I have to schedule one job in crontab, but with two parameters.
- Sysdate in YYYYMMDD format
- Sysdate - 7 in YYYYMMDD format
Please suggest how to do that.
Thanks in advance.
Hi ,
I have to schedule one job in crontab, but with two parameters.
Please suggest how to do that.
Thanks in advance.
Have a read of two things:-
You may need use cron to call a wrapper script that works these out and then calls the real script you want, e.g.:-
$ crontab -l
00 23 * * * /my_home/wrapper_script
$ cat wrapper_script
#!/bin/ksh
d1=20140603 # Need to get this from the date command
d2=20140527 # Need to calculate this from the date command
/usr/local/scripts/main_script $d1 $d2
I hope that this helps, but in any case:-
Robin