Hi all,
A client’s primary in-house software application writes a backup file to a certain folder. The server (which runs 24/7) will create the backup file once per day, including on Sunday; however, the office is only open for business Monday-Saturday.
I’ve written a Folder Action that keeps an eye on the backup folder for each day’s new, daily backup file, then automagically copies the new file to an external hard drive, and to a USB keychain drive. The external hard drive is always connected; the keychain drives are automagically ejected once the copy has completed, then swapped out once per day with the next day’s keychain drive so as to be prepared for the following evening’s backup (the keychains go off-site for disaster protection). It’s actually quite pretty, with prompts for keychain drives with the proper volume name, automagic ejecting of the keychain drive and a “go home!” confirmation, etc.
The Folder Action works great, Monday-Saturday. However, I would like to make the Folder Action simply exit on Sunday (without attempting to copy the backed-up data), as no actual transactions take place that day and regardless, there’s no one there to swap out the keychain drive when they’re prompted to do so. I suppose I could enclose everything in the following:
if (weekday of (current date)) is not "Sunday" then
work my mojo
end if
However, that seems heavy-handed to me. In a larger sense (and my apologies if this is one of those I’ve-forgotten-more-than-many-will-ever-know moments), I’d like to use something like the following:
if (weekday of current date)) is "Sunday" then
quietly end this script, exit out gracefully with no dialogs, and have a nice day
end if
I’m not looking for a full-on re-write of my existing code”instead, just the construct needed to tell the Folder Action to stop in its tracks, without generating a visible error message.
Any tips for a fellow scripter?
Thanks much for the time,
MBJ