Restore config

Status
Not open for further replies.

Brian Weaver

Cadet
Joined
Nov 29, 2016
Messages
6
Hi all... I'm testing recovery from lost boot drive in freenas 9.10.1-u4 I have backups of the config. So here is how I am testing.
Take the boot drives off line by disconnecting them
Put a new drive in its place (Question 1 Does it need to be the same size as the original)
Rebuilding with the same version
Importing the volumes
Then going to general and trying to upload the config. At this point I get an error saying "The uploaded file is not valid"

Not sure where to go from here? Did a search for the error message but found nothing I could use.
Any ideas on what to try next?
Thanks
 

Brian Weaver

Cadet
Joined
Nov 29, 2016
Messages
6
Here is the script i'm using to copy and keep configs for 30 days
cp /data/freenas-v1.db /mnt/backup/config-`hostname`-`cat /etc/version | awk -F'[- ()]' '{print $2 "_" $4}'`-`date "+%Y%m%d%H%M"`.db && find /mnt/backup/* -mtime +30 -type f -delete
 

Brian Weaver

Cadet
Joined
Nov 29, 2016
Messages
6
OK so never mind I did a test from a save config file on my computer and it worked. Looks like the way I'm transferring the files is the problem. I think it may be that I left ftp in ascii mode? Going to check this next.

#!/bin/bash
HOST='your.ftp.site'
USER='remoteusername'
PASSWD='remotepasswd'

ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd upload
ls -la
bye
EOT

The only thing I see missing is a folder in /mnt called /backup where I stored the backups. Anyone know how I can get this back?
 

Brian Weaver

Cadet
Joined
Nov 29, 2016
Messages
6
Ok made some adjustments to my files. put the backup folder on the VG and changed the ftp to bin. Everything is working great now.
 
Status
Not open for further replies.
Top