ansitest/proxmox/BKPDEST.mrg

33 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-05-20 13:35:15 -06:00
# bash - this is defining where backup tars, etc will be stored - can be local, sshfs, CIFS, NFS but must be R/W
2024-02-19 11:07:45 -07:00
# can be overridden b4 sourcing
2024-05-20 13:35:15 -06:00
# NOTE this script should be in /root/bin/boojum and be chmod +x
# it is sourced / used by several backup scripts
# you can have it elsewhere (like /root) for convenience and soft-symlink to it if needed
# but the scripts are checking for it in /root/bin/boojum
2024-02-19 11:07:45 -07:00
2024-05-20 13:37:56 -06:00
# xxx TODO EDITME
2024-02-19 11:07:45 -07:00
#[ "$bkpdest" = "" ] && export bkpdest=/mnt/imac5
[ "$bkpdest" = "" ] && export bkpdest=/mnt/seatera4-xfs
[ `echo $bkpdest |grep -c "/mnt/"` -gt 0 ] && mount $bkpdest # mount if not ZFS!
[ `echo $bkpdest |grep -c "/media/"` -gt 0 ] && mount $bkpdest # mount if not ZFS!
# from failexit.mrg
function failexit () {
echo '! Something failed! Code: '"$1 $2" # code # (and optional description)
exit $1
}
[ -e "$bkpdest/NOTHERE" ] && failexit 99 "$bkpdest NOTHERE -- NOT MOUNTED"
# "If" checking for NOTHERE file...
chkmount=`df |grep -c $bkpdest`
[ $chkmount -gt 0 ] || failexit 99 "$bkpdest NOT MOUNTED"
# NOTE code 199 is generally could not cd to dir
2024-05-20 13:35:15 -06:00
export myhn=$(hostname)