# How to backup a jail ?



## dieselnutjob (Jul 16, 2011)

I have a Soekris Net5501 which is running two jails.
One jail is a web server and the other a mail server.

As the mail server has eight years of emails for the entire family on it I need to figure out how to back it up.
I am thinking that I could log into the base operating system and just tar up the entire jail, and then sftp it over to my backup server.  In fact I could script this and do a regular cron job.

Do I have to stop the jail, or any of the daemons before I copy the jail into a tar file?


----------



## graudeejs (Jul 16, 2011)

I'd use tar. Also I wouldn't stop jail. When you restore jail from tar, rc system will take care of all pid files.
At least I don't see any problem
Just remember to add -p flag when you restore jail from tar


----------



## fbsd1 (Jul 16, 2011)

If you used qjail from the ports system, it has its own jail backup built in.


----------

