This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

Backup of POOLs

Problems, solutions, software
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
dpatino1
NewUser
NewUser
Posts: 8
Joined: 04 Mar 2013 16:33
Status: Offline

Backup of POOLs

Post by dpatino1 »

I have a couple ZFS pools on nas4free that I need to have backed up efficiently. I'd like to retain daily incrementals and weekly fulls for set periods of time. I have a second san on the same network that the data will be stored on. This is my first venture into non-windows file storage and am trying to figure out how to accomplish this. I tried to use rsync, but was unable to get to do what I want. I read that bacula and amanda can be installed on nas4free, but I couldn't find instructions on how to do that. Is there a better solution or can someone point me in the right direction?

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4865
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: Backup of POOLs

Post by raulfg3 »

try some of this usefull script viewtopic.php?f=70&t=2197&start=25

Please read entire post to know if is what you want / need.
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)

Wiki
Last changes

HP T510

dpatino1
NewUser
NewUser
Posts: 8
Joined: 04 Mar 2013 16:33
Status: Offline

Re: Backup of POOLs

Post by dpatino1 »

Thanks for those, but the backup script isn't designed to backup to a remote share. I have a windows smb share mounted that I want to backup to.

dpatino1
NewUser
NewUser
Posts: 8
Joined: 04 Mar 2013 16:33
Status: Offline

Re: Backup of POOLs

Post by dpatino1 »

Alright, so I got a script running that seemed to work when I tested it, but once I scheduled it with Cron, it doesn't work properly. It rsyncs the files and sends an email, but the tar line doesn't work and the log file is empty. Does anyone know what might be the problem?

Code: Select all

#!/bin/sh
{
#########################################################################################
# File: 	casedatabackup.sh
# Author: 	Daryl Patino
# Date:	03-18-2013
# Purpose:	Daily incremental backups and weekly archive of backups using rsync
#
# 
# Important Usage Notes:
# -cp this file with a different name to retain this file as a template
# -edit logfilename located in BODY variable and end of script to match share
# -view existing scripts for examples
# -end all directory variables with /
# -must run the following command on the file "chmod u+x /path/file"
#########################################################################################


#########################################################################################
# Constant variables, do not change
#########################################################################################

DAY=$(date +%A)
DATE=$(date +%m_%d_%y)
PRINTF=/usr/bin/printf
MSMTP=/usr/local/bin/msmtp
MSMTPCONF=/var/etc/msmtp.conf


#########################################################################################
# Dynamic variables, changeable
#########################################################################################

# Mail settings
FROM="nas4free@usinfosec.com"
TO="helpdesk@usinfosec.com"
MDIR="CaseData"
SUBJECT="$MDIR Backup Report"
BODY="$(cat /mnt/support/logs/casedata.log)"

# Sync settings
RSOURCE="/mnt/POOL/CaseData/"
RDEST="/mnt/syl-s-012/Backups/CaseData/Daily/"
ASOURCE=$RDEST
ADEST="/mnt/syl-s-012/Backups/CaseData/Weekly/"


#########################################################################################
# Backup operations
#########################################################################################

# Daily file sync
rsync -a --stats $RSOURCE $RDEST

# Weekly archive and follow up sync to remove deleted files
if [ $day = "Sunday" ]; then
	tar -zcf $ADEST$DATE.tar.gz $ASOURCE
	rsync -a --delete --stats $RSOURCE $RDEST
	find $ADEST -mtime +14 -exec rm {} \;
fi

# Sends email of log file
$PRINTF "From:$FROM\nTo:$TO\nSubject:$SUBJECT\n\n$BODY" | $MSMTP --file=$MSMTPCONF -t

} > /mnt/support/logs/casedata.log

dpatino1
NewUser
NewUser
Posts: 8
Joined: 04 Mar 2013 16:33
Status: Offline

Re: Backup of POOLs

Post by dpatino1 »

I ran a couple commands individually and got this
syl-s-030:~# tar -zcfv /mnt/syl-s-012/Backups/CaseData/Weekly/date.tar.gz /mnt/syl-s-012/Backups/CaseData/Daily/
tar: Removing leading '/' from member names

/: write failed, filesystem is full
tar: Write error
Neither of those directoy locations are local to the nas4free box.

Post Reply

Return to “Data recovery and backups”