View Single Post
  #193 (permalink)  
Old 11-05-2009, 08:07 AM
borngunners borngunners is offline
Advanced Member
 
Posts: 191
Default

liverpoolfcfan. I am sorry about your champions league trauma. Back to your script from your first post. Is it the solution to the DAR problem -A option that I am having or for something else? This is what my script looks like:
Quote:
function do_backup {
TYPE=$1
if [ $TYPE = "full" ]
then
PREFIX=$FULL_PREFIX
elif [ $TYPE = "diff" ]
then
PREFIX=$DIFF_PREFIX
else
echo "Invalid Backup Type!"
exit 1
fi
# Check for required directories and helper apps
for REQ_BIN in $DAR_BIN $MAILX_BIN $RSYNC_BIN $SSH_BIN $MD5SUM_BIN $UUENCODE_BIN
do
check_req_bin $REQ_BIN
done

for REQ_DIR in $ZM_HOME $SYNC_DIR $ARCHIVEDIR $TO_MEDIA_DIR
do
check_req_dir $REQ_DIR
done
echo "$TYPE Backup started at: `date +%H:%M`"
# Check to make sure we have not already done a backup today.
CURRENTNAME2=`ls -A -1 "$ARCHIVEDIR""$BACKUPWEEK"_"$BACKUPNAME"_"$BACKUPD ATE"_"$PREFIX"*dar 2> /dev/null | head -qn1`
CURRENTFULL=`ls -A -1 "$ARCHIVEDIR""$BACKUPWEEK"*$FULL_PREFIX*dar 2>/dev/null | cut -d . -f1 `

if [ -f "$CURRENTNAME2" ]
then
echo "Full Zimbra Backup failed! FOUND A BACKUP WITH SAME NAME"
echo "Please check why! You should only run this script once a day with the current backup date settings!"
mail_log
exit 1
elif [ $CURRENTFULL ] && [ $TYPE = "full" ]
then
# Look for old backups and put then in directory from where you write them to some form of
# storage media
LAST_FULL_DAR=`ls -A -1 $ARCHIVEDIR | grep $BACKUPNAME | cut -d _ -f1 | head -n1`

if [ -z "$LAST_FULL_DAR" ]
then
echo "No old backups found"
elif [ "$LAST_FULL_DAR" -lt "$BACKUPWEEK" ]
then
echo "Old backups found...old week= $LAST_FULL_DAR current week= $BACKUPWEEK"
echo
for i in `ls -A -1 "$ARCHIVEDIR""$LAST_FULL_DAR"_"$BACKUPNAME"*`
Please let me know if there is anything in my script causing that to happen. Also, how do I make it write to my dvd/rw without me involving. I have already setup a remote backup.

Thanks,
Reply With Quote