[PLUG] BASH script make a backup...

King Beowulf kingbeowulf at gmail.com
Sun Apr 5 00:35:45 UTC 2020


On 4/4/20 4:06 PM, michael at robinson-west.com wrote:
> tar: root/web_safety/build/squid/squid-4.9/debian/.debhelper/squid/dbgsym-root/usr/share/doc/squid-dbgsym: File removed before we read it
> tar: root/web_safety/build/squid/squid-4.9/debian/.debhelper/squid-cgi/dbgsym-root/usr/share/doc/squid-cgi-dbgsym: File removed before we read it
> tar: root/web_safety/build/squid/squid-4.9/debian/.debhelper/squid-purge/dbgsym-root/usr/share/doc/squid-purge-dbgsym: File removed before we read it
> tar: root/web_safety/build/squid/squid-4.9/debian/.debhelper/squidclient/dbgsym-root/usr/share/doc/squidclient-dbgsym: File removed before we read it
> tar: root/web_safety/build/squid/squid-4.9/debian/squid-common/usr/share/squid/errors: File removed before we read it
> 
> I've never seen tar errors like this before...
> 
> ...
> tar --one-file-system --keep-directory-symlink -chjf $dump_dir/root.tar.bz2 root/ 2>$dump_dir/tar_err.txt
> ...
> 

I was in error about the -h parameter.  Sorry about that. To much time
at home I suppose.

https://www.gnu.org/software/tar/manual/html_node/dereference.html

-h is only used to follow the symlink and grab the linked file.

$ ls -l tar_test/
total 0
lrwxrwxrwx 1 beowulf users 9 Apr  4 17:23 symtest2.txt -> test2.txt
-rw-r--r-- 1 beowulf users 0 Apr  4 17:23 test1.txt
-rw-r--r-- 1 beowulf users 0 Apr  4 17:23 test2.txt

$ tar -cvjf tar_test.tar.bz2 tar_test/
tar_test/
tar_test/test1.txt
tar_test/test2.txt
tar_test/symtest2.txt

$ mv tar_test.tar.bz2 /tmp/tar_test.tar.bz2
$ cd /tmp
$ tar -xjf tar_test.tar.bz2
$ $ ls -l tar_test
total 0
lrwxrwxrwx 1 beowulf users 9 Apr  4 17:23 symtest2.txt -> test2.txt
-rw-r--r-- 1 beowulf users 0 Apr  4 17:23 test1.txt
-rw-r--r-- 1 beowulf users 0 Apr  4 17:23 test2.txt


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20200404/e429e4fc/attachment.asc>


More information about the PLUG mailing list