jails backup jail pax: File is too large for cpio format

Hello.
I make a vps jail backup.
When I backup, I see a message.
ezjail-admin archive -d /mnt/backup/2020/ -f my_site
pax: File is too large for cpio format ./var/db/mysql/pr_otb/wp_zd_photos.ibd
The file is 15 GB /var/db/mysql/pr_otb/wp_zd_photos.ibd
ls -lh /var/db/mysql/pr_otb/wp_zd_photos.ibd
-rw-r----- 1 mysql mysql 15G Oct 20 08:10 /var/db/mysql/pr_otb/wp_zd_photos.ibd
I understand that this file /var/db/mysql/pr_otb/wp_zd_photos.ibd will not be included in the archive.
How to be?
 
Hello!
I make jail backups in this way:

1) stop all jails. It needs for data consistency, especially for jails with databases like mysql
2) Inplace make freebsd UFS snapshot using mksnap_ffs. It takes a little bit of time for volume 100G
3) start jails
4) mount latest snapshot and rsync all files to external backup server
5) At backup server 'storage for backups' snapshoted every month, week, day.
Scripted snapshot cleanup on backup storage server leave last 3 daily, 4 weeky, 12monthly snaps on 2TB volume.
2TB volume snapshoting takes a lot of time, but it no matters.

I use some my own small scripts for all of this things.
Every jail with more than 1000000 anysized files are copied successfully.

I have a good experience with this method.
I receive fully consistent backups with minimal downtime, while snapshot made.
Finally, when production jails are running, rsync copy only changed files since previous run.

I can public some of my scripts, if you need it.
 
I was thinking of using tar when backing up.
Which tar keys are better for backing up?
 
Here is the example:

Bash:
#!/bin/sh

backup_dir='/home/backups/system/'
incfile=`/usr/bin/dirname $0`"/backup_system_incfile" # file/dirs include to backup
exclfile=`/usr/bin/dirname $0`"/backup_system_exclude" # file/dirs exclude from backup
archfile=${backup_dir}system_`hostname -s`_`date "+%Y%m%d-%H%M"`.tgz
pattern="/home/jails/*/etc/ /home/jails/*/usr/local/etc/ /home/jails/*/var/db/pkg/ /home/jails/*/var/db/ports/ /home/jails/*/var/cron/"


echo "Backup hostname:"
cat ${incfile}
echo ${pattern}
echo ""
echo ""

umask 027
tar -czf ${archfile} -X ${exclfile} -T ${incfile} ${pattern} && ls -lh ${archfile} || echo "ERROR: Backup failed."
 
Formats could use by pax all have 8G size limit for single file(format implement buildin).
You can chose tar(libarchive backend), zip or star, all no single file size limited.

zip -r0 jail.zip jail
star -c f=jail.tar jail


I recommend zip, because you can find it very eay on any platform.
 
Back
Top