Re: Executing cronjob on every first business day of the month



martin.witte@xxxxxxxxx wrote:

afaik you can't do this in cron, I would start my script by checking
the result of date +%a, when thats Sat or Sun I would exit the script

Then, if the first day is Sun or Sat, the script never runs this month.

One option is to reschedule the job to Monday,
if the first day of month falls on weekend.
for instance:

30 7 1 * * date +%a | egrep -qs '^S' && echo Script | at now Monday ||
Script

but... what about national holidays?

.



Relevant Pages

  • vidmode >0 causes CLI scrolling to not work properly
    ... pentium1:/usr/src/linux-2.6.4# exit ... Script started on Sun Mar 14 11:05:12 2004 ... ddc00000-ddcfffff: PCI Bus #01 ...
    (Linux-Kernel)
  • Video mode >0 causes scrolling anomaly after X exits
    ... pentium1:/usr/src/linux-2.6.4# exit ... Script started on Sun Mar 14 11:05:12 2004 ... ddc00000-ddcfffff: PCI Bus #01 ...
    (Linux-Kernel)
  • Update: Shell script to auto-change password before password expiry
    ... Gold Sun wrote: ... We have a job that would fail to send reports out if the root ... Would anyone care to contribute a shell script that will ... Download the latest ringtones, games, and more! ...
    (SunManagers)
  • Re: Two queries about a DEC server
    ... > Is it due to some artefact which ca be duplicated on a SUN box ... > but if I try to run it, I get the error: command not found. ... Did you edit that script on a Windoze machine? ... "It's not the despair... ...
    (comp.unix.misc)
  • Re: Two queries about a DEC server
    ... > Is it due to some artefact which ca be duplicated on a SUN box ... > but if I try to run it, I get the error: command not found. ... Did you edit that script on a Windoze machine? ... "It's not the despair... ...
    (comp.unix.shell)