GNU tar can't be told to --empty-file* /var/cache/swap/swap1* ADDING THE LIVE RUINING FILE WILL CRASH TAR/SYSTEM
A:* Exclude the file* , *yet add an as empty*... as the boot will expect it, it will 0 out on shutdown.. in this use case, BOOT will expect it.. , if one restored.. it will overwrite as is , just worried over kernel panic if it is gone.. also if your sharing a fs dump , --emptyfile ie /etc/shadow , password etc... ie empty other files for security reasons clean PII in some instances.. --empty-file /$path/.... nice to have feature... request.. but if I may , touch fake-empty file ??? how to append to tar as */var/cache/swap/swap1* 1down votefavorite <https://superuser.com/questions/1214855/linux-backup-include-empty-swapfile#> 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 bast@#$*) as this is RPI3 <https://www.raspberrypi.org/products/raspberry-pi-3-model-b/> , 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... ------------------------------ <//launchedindfw.com/> *View My current Resume on Resumonk* https://www.resumonk.com/Fqx1XonLErULkVSOiZASsQ ------------------------------ [image: data-pin-nopIn=true]*Associate of (ISC)² * <https://www.youracclaim.com/badges/1afc396a-171a-484a-b1a3-95612eb24af9/public_url>*Issued to Michael Issued by (ISC)²** (CISSP Exam passed)* [image: http://lpc1.clpccd.cc.ca.us/lpc/mdaoud/CNT69/images/Security+Logo.jpg][image: http://www.sscc.edu/specialized/images/logo-comptia-network.jpg][image: http://www.axisdiscovery.com/img/assn-mcp-badge.png] ------------------------------ [image: HEIghT="205] <http://2.gravatar.com/avatar/868448f7851a94ec271b8534cb3072f1?size=420>[image: hEIghT=194] <http://2.gravatar.com/avatar/868448f7851a94ec271b8534cb3072f1?size=420> *Michael Robert Lawrence m...@michaellawrenceit.com <m...@michaellawrenceit.com> * *Work michael.lawre...@atos.net <michael.lawre...@atos.net>* *Information Security Analyst II / Engineer * *Dallas Fort Worth Residence : 2205 Village Circle # 714 Bedford, Texas , 76022 Home: +1-817-857-3521 <1.817.857.3521> Cellular:+1-317-909-2009 <+1-317-909-2009>* *http://www.linkedin.com/in/itsecmichaelrlawrence <http://www.linkedin.com/in/itsecmichaelrlawrence>* [image: View Michael Robert Lawrence's profile on LinkedIn] <http://www.linkedin.com/in/itsecmichaelrlawrence> *skype:Necrose99 * <http://www.linkedin.com/in/itsecmichaelrlawrence> <http://twitter.com/lonewolf359> <http://about.me/itsecmichaelrlawrence> <http://www.flickr.com/photos/chimerawind/> <http://klout.com/#/lonewolf359> <http://plus.google.com/102933855470029837365> <http://lonewolf359.tumblr.com/> <http://foursquare.com/lonewolf359> <http://github.com/necrose99> [image: My QR vCard] My vCard Get your own email signature <https://wisestamp.com/email-install?utm_source=promotion&utm_medium=signature&utm_campaign=get_your_own> On Fri, Jun 2, 2017 at 3:57 PM, Sergey Poznyakoff <g...@gnu.org.ua> wrote: > Michael R. Lawrence CISSP <m...@michaellawrenceit.com> ha escrit: > > > https://superuser.com/questions/1214855/linux- > backup-include-empty-swapfile > > > > tar -cvJf backup.tar.xz --exclude=/backup.tar.xz --one-file-system / > > > > --emptyfile /var/swapfile alias EXCLUDE , touch > filename > > /var/swapfile > > @ tar.xz (etc) > > > > touching the the swap file crashes tar... , however a empty placeholder > > wanted root owned... , as it needs to be , as its were RPI-3 adds swap > ram. > > Could you take the trouble to explain what did you mean? With all due > respect, this seems completely undecipherable to me. > > Regards, > Sergey > >