#!/bin/bash

#
# crontab entry for every minute:
#
# */1 * * * * /opt/pos/common/bin/live_backup.sh
#

# live backup target
PEN=`find /media/ | grep live_backup | head -1 | xargs dirname`

if [ "$PEN" = "" ]; then
  echo "Can't find any PEN with the 'live_backups' folder ..."
  exit
fi

if [ ! -f "$PEN/live_backups/backup" ]; then
  echo "Can't find 'backup' script in $PEN/live_backups ..."
  exit
fi

$PEN/live_backups/backup

