[X-Unix] shell scripting

Doug McNutt douglist at macnauchtan.com
Thu Jan 15 19:02:05 PST 2004


At 20:34 -0600 1/15/04, Bert Knabe wrote:
>I have a relatively simple task, but little programming knowledge. I need to have a folder checked and files copied to another folder. I originally planned to do this in Applescript, but Applescript has proven less than effective.

I'd like to know more about conditions in which folder actions are unreliable. The only thing I have had any problem with is getting the action to occur when the file is not dragged to a folder using the finder but is placed there by a running application other than Finder.

> I need to either have a folder watched, and when new files are added, copy them to another folder on a different volume, or have the folder checked every so often and files added since the last check copied to another folder on a different volume.

It should be straightforward to create a shell executable - x permission bit set - that runs as a cron job (man cron) every half hour. It can check modification dates of files in the source and destination folder and make copies as required.  If the files have Mac resource forks, or if Mac Finder info is important ,/Developer/Tools/CpMac is needed as opposed to a UNIX cp which pays attention only to the data fork.

-- 
-->  There are 10 kinds of people:  those who understand binary, and those who don't <--



More information about the X-Unix mailing list