#!/bin/sh # source file directory srcd=/usr/local/elog/ # backup all files newer than 25 hours date=$(date -d "-65minutes" "+%Y%m%d %H:%M") # backup file directory tard=/logbooks_backup # backup tar file name tarf=$tard/$(date +%a%H%M.tar) rm -f $tarf # do not backup files that match patterns in this file excf=/usr/local/elog/utilities/exclude-logbooks # create backup cd $srcd tar --ignore-case -X $excf --newer "$date" -cf $tarf . logbooks/*