How to backup safely Jails of FreeNAS

Status
Not open for further replies.

Mouftik

Dabbler
Joined
May 12, 2014
Messages
41
Hi all,

After losing my Plex Plugin due to a dying Jail drive ... Hopefully with 3 films so not a big mess. I wanted to have some sort of Jail backup (with for example 30 days of backups).

Is someone making this or am I the only one to think this data is important :) ?

I thought about multiple solution:
- Zip the jail and copy with CRON
- Snapshot replication (but I was not able to set up this configuration ...)
- Just copy snapshots
Has someone used one of this and tested to restore ?
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Many people keep their media data on a main pool with redundancy, even if the jail is on a separate drive. It is easy to keep a backup of the jail on the main pool too, as the jails do not change much. That may protect a against a single drive failure, but does not, of course, solve the backup problem. Some automated system is much better then manual, as you could forget to do it. What wouldn't work about replication?
 

Mouftik

Dabbler
Joined
May 12, 2014
Messages
41
I had some issue with SSH configuration but seeing some tuto shows the solution so now I have a fully configured off-machine backup (because on the same site but will come after), but I am now checking how to recover from disaster.
I have configured a plex and checked some file as seen and try to delete the jail, to know how to recover my files ... Now I am stuck here on how to recover :)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
the plex plugin keeps all its metadata in /var/db/plexdata, so if save that folder you can always recreate a previous setup.
 

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
the plex plugin keeps all its metadata in /var/db/plexdata, so if save that folder you can always recreate a previous setup.

I dont have permissions to do this through CIFS. Last time I tried updating permisions in the Jail it caused major issues. Can you help
 

Mouftik

Dabbler
Joined
May 12, 2014
Messages
41
I just use the path to the Jail, which is something like /mnt/JailStuff/plexmediaserver_1/var/db and tar this entire folder.

I have this script running every night:

Code:
#!/bin/bash
DATE=`date +%Y%m%d`                                                           

tar -cjf /mnt/backups/backup-$DATE.tar.bz2 -C /mnt/Jailstuff/plexmediaserver_1/var/db/ plexdata


I have tested and if the jail crash the only thing to do is reinstall the jail, stop it, replace the db folder with one version. You might need to re-select the server, because event if this is the same server, Plex just doesn't found the elements, but every seen films and TV shows are good as far as I have tested.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I dont have permissions to do this through CIFS. Last time I tried updating permisions in the Jail it caused major issues. Can you help
I'd personally use ssh/sftp so that might not be helpful to you.
 

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
I just use the path to the Jail, which is something like /mnt/JailStuff/plexmediaserver_1/var/db and tar this entire folder.

I have this script running every night:

Code:
#!/bin/bash
DATE=`date +%Y%m%d`                                                          

tar -cjf /mnt/backups/backup-$DATE.tar.bz2 -C /mnt/Jailstuff/plexmediaserver_1/var/db/ plexdata


I have tested and if the jail crash the only thing to do is reinstall the jail, stop it, replace the db folder with one version. You might need to re-select the server, because event if this is the same server, Plex just doesn't found the elements, but every seen films and TV shows are good as far as I have tested.

Sorry for the dumb question but is this a script you run through freenas's command line?
 

Mouftik

Dabbler
Joined
May 12, 2014
Messages
41
Sorry for the dumb question but is this a script you run through freenas's command line?

There is no dumb question :)

It is a script file I created, and it is run with the CRON inside FreeNAS, so I can schedule the backup every night without having to take care about launching it very night. But you can run the 'tar' command from the FreeNAS shell directly (just modify the path of directories), which is the one at the left bar in FreeNAS GUI.
If you want to make a CRON you will just need to create a file, give the file exec permissions, and create the CRON job ... and that's it :)
 

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
Thanks much appreciated!
 
Status
Not open for further replies.
Top