#!/bin/sh # jsmall@soliantconsulting.com 20090204 # with inspiration from Rob Russell SumWare Consulting # ------------------------------------------------------------------------- # NO USER SERVICEABLE PARTS. MODIFY THE CALLING ZIP SCRIPTS TO CHANGE CONFIG. # first argument should have a trailing slash. # second argument should not have trailing slash. # ------------------------------------------------------------------------- # source=$1 destination=$2 logger -t FMBACKUP zip archive from $source logger -t FMBACKUP zip archive to $destination # # ------------------------------------------------------------------------- # suffix is the time stamp to append to the destination suffix="$(date +%Y%m%d_%H%M).zip" # ------------------------------------------------------------------------- # create symlink files in tmp folder, to deal with spaces in file paths sourcelink="/tmp/soliant001.ln" ln -s "$source" "$sourcelink" destinationlink="/tmp/soliant002.ln" ln -s "$destination$suffix" $destinationlink # ------------------------------------------------------------------------- # copy with pkzip compression and preserve resources ditto -c -k --rsrc --sequesterRsrc "$sourcelink" "$destinationlink" #ditto -c -k --rsrc "$sourcelink" "$destinationlink" # ------------------------------------------------------------------------- # clean up the symlinks we created earlier rm -f $sourcelink rm -f $destinationlink