10.3 C
New York
Tuesday, May 20, 2025

automator – Is there a simple approach to routinely schedule a transfer of recordsdata matching a sure sample from a consumer listing to a USB drive?


I am seeking to automate a backup course of that entails transporting backup recordsdata (with names within the kind “*.savf”) first onto a Mac Mini (operating Yosemite), after which, as soon as they’re on the Mini, transferring them from the place they have been initially positioned onto exterior USB drives. It is a course of that was previously operating on a really giant, very noisy, and really worn-out Linux field.

To date, I’ve the recordsdata arriving on the Mini. However can anyone level me in direction of a simple approach to automate transferring them to the exterior drives?

You need particulars, right here they’re:

The 2 exterior packing containers being backed up (AS/400s, therefore the “SAVF” extensions), both each night at a specified time, or when they’re instructed to close themselves down, will run a program that checks specified libraries to see if there may be something in them that wants backing up. If a library wants backing up, it will likely be saved to an AS/400-specific assemble referred to as a “save file,” after which FTP’d to the backup server (every has its personal account on the backup server, with its own residence listing).

On the Linux backup server, as a result of I couldn’t work out a approach for it to FTP on to the exterior drives, there was a shell script, operating as a cron job, beneath root authority, which copied these save recordsdata to the exterior drives, then deleted them from the house directories.

I’ve the primary half working very properly on the Mac. Unsure how one can make the second half work.

5/8/2023: I’ve simply efficiently reverse-engineered my very own shell script:

#!
cd /Customers/foo
cp *.savf /Volumes/BACKUP/foo
mv *.savf /Volumes/BACKUP2/foo

cd /Customers/bar
cp *.savf /Volumes/BACKUP/bar
mv *.savf /Volumes/BACKUP2/bar

Now, to make it execute at a particular time of day, beneath root authority, and ignore all errors . . .

**** Could tenth ****

I now have a plist in /Library/LaunchDaemons (put in late yesterday afternoon), BUT IT DIDN’T WORK! It is referred to as “sweep.plist,” and it’s as follows:

<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Laptop//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
<key>Label</key>
<string>sweep</string>
<key>Program</key>
<string>/Customers/europa/sweep.sh</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>8</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>

And I did a launchctl load /Library/LaunchDaemons/sweep.plist (both sudo’d or in a sudo bash) as soon as it was in place. I am completely sure that after I did so yesterday, “sweep” confirmed up in a launchctl listing, however it did not execute, and it now not exhibits up after I do a launchctl listing.

Any concept the place to search for the issue?

New: I simply checked the system log, and located this: Could 10 08:00:05 Europas-Mac-mini com.apple.xpc.launchd[1] (sweep[1299]): Program specified by service isn't a Mach-O executable file.

Wanting on the shell script with a ls -l, it exhibits permissions as -rwxr-xr-x@

Related Articles

Latest Articles