-2

we have a cron job that run every Saturday at 01:00 (0 1 * * 6) we want to modified to run every 2 weeks on Saturday at 01:00.

Thanks.

xzeneize
  • 1
  • 1
  • 3

1 Answers1

0

The simplest way is to wrap your job in a script

 week=$(date +%V); if [ $(( $week % 2 )) -eq 0 ]; then echo "run program"; fi

Then just run the wrapper every week... Change the 0 to a 1 for odd weeks..

Daniel Widrick
  • 3,418
  • 2
  • 12
  • 26