Skip to main content
added 130 characters in body
Source Link
Rahul
  • 14k
  • 4
  • 46
  • 56

You can do something like,

0 0 * * 5   /usr/bin/python /var/scripts/PLW.pl && if [[ $? -eq 0 ]]; then \
/bin/bash /path/to/run_once.bash ; \
fi

Note : && /bin/bash /path/to/run_once.bash will only run if previous command run successfully. So instead of using exit code, you can use &&'s inbuilt functionality.

You can do something like,

0 0 * * 5   /usr/bin/python /var/scripts/PLW.pl && if [[ $? -eq 0 ]]; then \
/bin/bash /path/to/run_once.bash ; \
fi

You can do something like,

0 0 * * 5  /usr/bin/python /var/scripts/PLW.pl && /bin/bash /path/to/run_once.bash

Note : && /bin/bash /path/to/run_once.bash will only run if previous command run successfully. So instead of using exit code, you can use &&'s inbuilt functionality.

added 14 characters in body
Source Link
Rahul
  • 14k
  • 4
  • 46
  • 56

You can do something like,

0 0 * * 5   /usr/bin/python /var/scripts/PLW.pl && if [[ $? -eq 0 ]]; then \
/bin/bash /path/to/run_once.bash ; \
fi

You can do something like,

0 0 * * 5   /usr/bin/python /var/scripts/PLW.pl && if [[ $? -eq 0 ]]; then /bin/bash /path/to/run_once.bash ; fi

You can do something like,

0 0 * * 5   /usr/bin/python /var/scripts/PLW.pl && if [[ $? -eq 0 ]]; then \
/bin/bash /path/to/run_once.bash ; \
fi
Source Link
Rahul
  • 14k
  • 4
  • 46
  • 56

You can do something like,

0 0 * * 5   /usr/bin/python /var/scripts/PLW.pl && if [[ $? -eq 0 ]]; then /bin/bash /path/to/run_once.bash ; fi