restore a periodic backup of pkg db

Ronald Klop ronald at klop.ws
Thu Dec 4 19:33:44 UTC 2014


Hi,

In /var/backup is a daily backup of the pkg db. The backup is not made by  
'pkg backup', but by 'pkg shell .dump' as I read in  
/usr/local/etc/periodic/daily/411.pkg-backup.

How do I restore this properly?
I can't use pkg backup -r <file> because the backup is a file containing  
sql statements.
Restoring by 'xzcat /var/backup/pkg.sql.xz | pkg shell' gives errors like  
the one below. (It does not understand hex strings very well.

Regards,
Ronald.


[root at sheeva /var/db/pkg]# xzcat /var/backups/pkg.sql.xz | pkg shell
Error: near line 33904: near  
"'0001308D03020101030002010104000101010300020101030001010103000E01010300060101040005010106000101010400010101040002010103000101010400030101050006010105000301010400010101040002010103000701010500040101040001010104000701010400020101040003010104000101010500060101030001010105000601010600030101030001010103030001010105000201010400010101040004010104000201010500030101040002010104000301010500010101040009010105000101010300010101040001010105000301010300020101040001010106000901010300010101030003010104000101010600020101040001010104000201010600010101060001010106000B0101030004010103000801010303000101010303000101010303000101010303000101010303000201010300080101050008010104000201010303000401010500030101040002010104000601010500010101040006010106000101010300030101040001010103000F0101050002010106000B0101030001010105000101350B0B01010600AF0101010600'":  
syntax error


More information about the freebsd-stable mailing list