https://help.ubuntu.com/community/BackupYourSystem/TAR
tar -cvJf backup.tar.xz --exclude=/backup.tar.xz --one-file-system /
I can add Exclude --exclude=/var/cache/swap/swap1...(not excluding the file segfaults the process and or can crash the lil address@hidden) as this is RPI3 , with some custom built packages... anyhow it would be nice to run this as a docker/rkt , for faster compile times...
I however would prefer to back up this file as a place-holder (ie 0 bytes or just an empty file...) for compatibility reasons I need the empty file...
(it will be replaced on boot with swap data... on boot) , however not sure if on restore it/system would flake out.?? , so hence i'm trying to add it back via script into the archive.
I'm just not sure how to get tar to add the 1 file as empty... or append archive as 1 empty file @ path...
How to append the empty file in my backup script would be a a plus , more elegant...
, however i can force it via docker/restore script. via touch /var/cache/swap/swap1 , or by stuffing it unmoundted (from RPI3) in my laptop or Sabayon-virtualbox etc... browse and stuff it back in... also a pain in the @####...
#!/bin/bash
#
# backup Gentoo RPi3 64 Necrose99
#
# if portage has lots of packages it will bloat the backup. , Swapfile will crash the backup.
# can use the script to dump fs also for docker.
tar -cvJf /backup.tar.xz --exclude=/var/cache/swap/swap1 --exclude=/usr/portage/* --exclude=/backup.tar.xz --one-file-system /
## TO DO , find a way to tuck the swap1 file back.. into archive...