From: 105 on
Hi

I have a backup shell script for each hour, that selectively copies a
defined backup created by FileMaker Server to (currently) the Shared User.

As it is I have a shell script for each hour, and a corresponding
launchd for each shell script. So 24 shell scripts, and 24 launchd


Is there an approach I can look at to consolidate this, or are
individually hour pairs (shell script, launchd) the most appropriate way
to approach this?


bup_1000.sh =

#!/bin/sh
SRC=/Library/FileMaker\ Server/Data/Backups/
DST=/Volumes/xsrv/Users/Shared/fms_backups/Hourly/
TODAY=$(date +%Y-%m-%d_1000)
ditto -c -k -rsrc -V "${SRC}Hourly_${TODAY}" "${DST}1000.zip"


corresponding com.cortical.bup1000d =

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.corticaldata.bup1000d</string>
<key>ProgramArguments</key>
<array>
<string>/Users/admin/Library/Scripts/bup_1000.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>10</integer>
<key>Minute</key>
<integer>10</integer>
</dict>
</dict>
</plist>

From: 105 on
Mac OS X.6.4 btw


From: Barry Margolin on
In article <4c37c85e$0$11110$c3e8da3(a)news.astraweb.com>,
105 <cortical(a)internode.on.net> wrote:

> Hi
>
> I have a backup shell script for each hour, that selectively copies a
> defined backup created by FileMaker Server to (currently) the Shared User.
>
> As it is I have a shell script for each hour, and a corresponding
> launchd for each shell script. So 24 shell scripts, and 24 launchd
>
>
> Is there an approach I can look at to consolidate this, or are
> individually hour pairs (shell script, launchd) the most appropriate way
> to approach this?

You shouldn't need different scripts. Use the same script for all of
them, and use date's %H format to get the hour for the backup file.

I'm not an expert on launchd (I still use crontab on my Mac), but can't
you just leave the Hour key out of the dictionary so it runs every hour?

>
>
> bup_1000.sh =
>
> #!/bin/sh
> SRC=/Library/FileMaker\ Server/Data/Backups/
> DST=/Volumes/xsrv/Users/Shared/fms_backups/Hourly/
> TODAY=$(date +%Y-%m-%d_1000)
> ditto -c -k -rsrc -V "${SRC}Hourly_${TODAY}" "${DST}1000.zip"
>
>
> corresponding com.cortical.bup1000d =
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> <key>Label</key>
> <string>com.corticaldata.bup1000d</string>
> <key>ProgramArguments</key>
> <array>
> <string>/Users/admin/Library/Scripts/bup_1000.sh</string>
> </array>
> <key>StartCalendarInterval</key>
> <dict>
> <key>Hour</key>
> <integer>10</integer>
> <key>Minute</key>
> <integer>10</integer>
> </dict>
> </dict>
> </plist>

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: 105 on
On 10/07/10 11:46 AM, Barry Margolin wrote:
> In article<4c37c85e$0$11110$c3e8da3(a)news.astraweb.com>,
> 105<cortical(a)internode.on.net> wrote:
>
>> Hi
>>
>> I have a backup shell script for each hour, that selectively copies a
>> defined backup created by FileMaker Server to (currently) the Shared User.
>>
>> As it is I have a shell script for each hour, and a corresponding
>> launchd for each shell script. So 24 shell scripts, and 24 launchd
>>
>>
>> Is there an approach I can look at to consolidate this, or are
>> individually hour pairs (shell script, launchd) the most appropriate way
>> to approach this?
>
> You shouldn't need different scripts. Use the same script for all of
> them, and use date's %H format to get the hour for the backup file.

ah I get it, $H embedded in the var; should have though of that.

Shell scripts are still exploratory area for me


thanks





From: 105 on
On 10/07/10 11:46 AM, Barry Margolin wrote:
> In article<4c37c85e$0$11110$c3e8da3(a)news.astraweb.com>,
> 105<cortical(a)internode.on.net> wrote:
>
>> Hi
>>
>> I have a backup shell script for each hour, that selectively copies a
>> defined backup created by FileMaker Server to (currently) the Shared User.
>>
>> As it is I have a shell script for each hour, and a corresponding
>> launchd for each shell script. So 24 shell scripts, and 24 launchd
>>
>>
>> Is there an approach I can look at to consolidate this, or are
>> individually hour pairs (shell script, launchd) the most appropriate way
>> to approach this?
>
> You shouldn't need different scripts. Use the same script for all of
> them, and use date's %H format to get the hour for the backup file.
>
> I'm not an expert on launchd (I still use crontab on my Mac), but can't
> you just leave the Hour key out of the dictionary so it runs every hour?
>
>>

In wasn't thinking; I only want to shell backup one fms backup per hour,
not the whole 24