about summary refs log tree commit diff stats
path: root/core/tar.html
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2016-08-22 21:41:57 +0100
committerSilvino Silva <silvino@bk.ru>2016-08-22 21:41:57 +0100
commit94e429f914be777770cf8094d728008a5efcf6ff (patch)
tree7ca8aab9588280a01ab435df90b2f87aef91a6db /core/tar.html
parent34759446ef0c8494ebf3195d558832de2a3729cd (diff)
downloaddoc-94e429f914be777770cf8094d728008a5efcf6ff.tar.gz
added all core files
Diffstat (limited to 'core/tar.html')
-rw-r--r--core/tar.html119
1 files changed, 119 insertions, 0 deletions
diff --git a/core/tar.html b/core/tar.html
new file mode 100644
index 0000000..a5dd1c4
--- /dev/null
+++ b/core/tar.html
@@ -0,0 +1,119 @@
+<!DOCTYPE html>
+<html dir="ltr" lang="en">
+    <head>
+        <meta charset='utf-8'>
+        <title>1. Tar</title>
+    </head>
+    <body>
+
+        <a href="index.html">Systolls Index</a>
+        <h1>2. Tar</h1>
+
+
+        <h2 id="tarbkup">2.1. Create Backup</h2>
+
+        <p>Script in core/scripts/<a href="scripts/backup-system.sh">backup-system.sh</a> use tldp
+        <a href="http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/server-backup.html">server backup</a>
+        and <a href="http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/server-restore.html">restore</a>
+        as a reference.</p>
+
+        <pre>
+        #!/bin/sh
+
+        echo -n "root directory you want backup (/mnt/): "
+        read ROOT_DIR
+
+        echo -n "where you want to save (/home/user): "
+        read DEST_DIR
+
+        echo -n "backup name (system_name): "
+        read BCK_NAME
+
+        echo $DES_DIR
+        echo $ROOT_DIR
+
+        tar --xattrs -zcpf $DEST_DIR/$BCK_NAME-`date '+%Y-%j-%H-%M-%S'`.tar.gz \
+            --directory=$ROOT_DIR \
+            --exclude=srv \
+            --exclude=var/ports \
+            --exclude=var/run \
+            --exclude=usr/src \
+            --exclude=mnt \
+            --exclude=home \
+            --exclude=dev \
+            --exclude=run \
+            --exclude=tmp \
+            --exclude=proc \
+            --exclude=sys .
+        </pre>
+
+        <h2 id="tarview">1.2. View content of tar</h2>
+
+        <p>List files inside tar;</p>
+
+        <pre>
+        $tar -tvf backup.tar.gz
+        </pre>
+
+        <p>To restore is better to use first t flag and then x,
+        this prevents any --absolute-paths problem;<p>
+
+        <pre>
+        $ tar -ztvpf full-backup-11-November-2045.tar.gz &gt; file.lst
+        </pre>
+
+        <h2 id="tarextract">1.3. Extract content from tar</h2>
+
+        <p>If you want to extrat to different directory;</p>
+
+        <pre>
+        $ tar xf full-backup-11-November-2045.tar.gz --directory=/mnt
+        </pre>
+
+        <p>If path is fine, extract everything;</p>
+
+        <pre>
+        $ tar --xattrs -xpvf full-backup-11-November-2045.tar.gz
+        </pre>
+
+        <p>Extract just one file;</p>
+
+        <pre>
+        $ tar --extract --file=core.tar.gz libidn#1.32-1.pkg.tar.gz
+        </pre>
+
+        <h2 id="taradd">1.4. Add content to tar</h2>
+
+        <p>Only uncompressed tar can append files without having
+        to extract and compress again.</p>
+
+        <p>First create a tar with all files in the current directory;</p>
+
+        <pre>
+        $ tar cpf core.tar *.tar.gz
+        </pre>
+
+        <p>List files before appending new file and after;</p>
+
+        <pre>
+        $ tar -tvf core.tar
+        $ tar --append --file=core.tar libidn#1.32-1.pkg.tar.gz
+        $ tar -tvf core.tar
+        </pre>
+
+        <h2 id="tarrm">1.5. Remove content of tar</h2>
+
+        <pre>
+        $ tar -tvf core.tar
+        $ tar --delete --file=core.tar libidn#1.32-1.pkg.tar.gz
+        $ tar -tvf core.tar
+        </pre>
+
+        <a href="index.html">Systolls Index</a>
+        <p>
+        This is part of the SysDoc Manual.
+        Copyright (C) 2016
+        Silvino Silva.
+        See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> for copying conditions.</p>
+    </body>
+</html>