{"id":13377,"date":"2019-04-01T23:08:36","date_gmt":"2019-04-01T23:08:36","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13377"},"modified":"2019-04-01T23:08:36","modified_gmt":"2019-04-01T23:08:36","slug":"system-tar-and-restore-a-versatile-system-backup-script-for-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/system-tar-and-restore-a-versatile-system-backup-script-for-linux\/","title":{"rendered":"System Tar and Restore \u2013 A Versatile System Backup Script for Linux"},"content":{"rendered":"<p><strong>System Tar and Restore<\/strong>\u00a0is a versatile system backup script for Linux systems. It comes with two bash scripts, the main script\u00a0<strong>star.sh<\/strong>\u00a0and a GUI wrapper script\u00a0<strong>star-gui.sh<\/strong>, which perform in three modes:\u00a0<strong>backup<\/strong>,\u00a0<strong>restore<\/strong>\u00a0and\u00a0<strong>transfer<\/strong>.<\/p>\n<p><strong>Read Also:<\/strong>\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-system-backup-tools\/\" target=\"_blank\" rel=\"noopener\">14 Outstanding Backup Utilities for Linux Systems<\/a><\/p>\n<h4>Features<\/h4>\n<ol>\n<li>Full or partial system backup<\/li>\n<li>Restore or transfer to the same or different disk\/partition layout.<\/li>\n<li>Restore or transfer backup to an external drive such as USB, SD card etc.<\/li>\n<li>Restore a BIOS-based system to UEFI and vice versa.<\/li>\n<li>Arrange a system in a virtual machine (such as\u00a0<a href=\"https:\/\/www.tecmint.com\/install-virtualbox-on-redhat-centos-fedora\/\" target=\"_blank\" rel=\"noopener\">virtualbox<\/a>), back it up and restore it in a normal system.<\/li>\n<\/ol>\n<h4>Requirements:<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/gtkdialog-create-graphical-interfaces-and-dialog-boxes\/\" target=\"_blank\" rel=\"noopener\">gtkdialog<\/a>\u00a00.8.3 or later (for the gui).<\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/18-tar-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">tar<\/a>\u00a01.27 or later (acls and xattrs support).<\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/rsync-local-remote-file-synchronization-commands\/\" target=\"_blank\" rel=\"noopener\">rsync<\/a>\u00a0(for Transfer Mode).<\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/10-wget-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">wget<\/a>\u00a0(for downloading backup archives).<\/li>\n<li><strong>gptfdisk\/gdisk<\/strong>\u00a0(for GPT and Syslinux).<\/li>\n<li><strong>openssl<\/strong>\/<strong>gpg<\/strong>\u00a0(for encryption).<\/li>\n<\/ol>\n<h3>How to Install System Tar and Restore Tool in Linux<\/h3>\n<p>To install\u00a0<strong>System Tar and Restore<\/strong>\u00a0program, you need to first install all the required software packages as listed below.<\/p>\n<pre>$ sudo apt install git tar rsync wget gptfdisk openssl  [On <strong>Debian\/Ubuntu<\/strong>]\r\n# yum install git tar rsync wget gptfdisk openssl       [On <strong>CentOS\/RHEL<\/strong>]\r\n# dnf install git tar rsync wget gptfdisk openssl       [On <strong>Fedora<\/strong>]\r\n<\/pre>\n<p>Once all the required packages installed, now it\u2019s time to download these scripts by cloning the\u00a0<strong>system tar and restore<\/strong>\u00a0repository to your system and run these scripts with root user privileges, otherwise, use the\u00a0<a href=\"https:\/\/www.tecmint.com\/su-vs-sudo-and-how-to-configure-sudo-in-linux\/\" target=\"_blank\" rel=\"noopener\">sudo command<\/a>.<\/p>\n<pre>$ cd Download\r\n$ git clone https:\/\/github.com\/tritonas00\/system-tar-and-restore.git\r\n$ cd system-tar-and-restore\/\r\n$ ls\r\n<\/pre>\n<div id=\"attachment_28937\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-System-Tar-and-Restore.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28937\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-System-Tar-and-Restore.png\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-System-Tar-and-Restore.png 822w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Install-System-Tar-and-Restore-768x215.png 768w\" alt=\"Install System Tar and Restore\" width=\"822\" height=\"230\" aria-describedby=\"caption-attachment-28937\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28937\" class=\"wp-caption-text\">Install System Tar and Restore<\/p>\n<\/div>\n<h4>Linux System Backup<\/h4>\n<p>First create a directory where your system backup files will be stored (you can actually use any other directory of your choice).<\/p>\n<pre>$ sudo mkdir \/backups\r\n<\/pre>\n<p>Now run the following command to create a system backup file in\u00a0<code>\/backups<\/code>\u00a0directory, the archive file will be compressed using the\u00a0<a href=\"https:\/\/www.tecmint.com\/xz-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">xz utility<\/a>, where the flags are.<\/p>\n<ul>\n<li><code>-i<\/code>\u00a0\u2013 specifies the operation mode(<strong>0<\/strong>\u00a0meaning backup mode).<\/li>\n<li><code>-d<\/code>\u00a0\u2013 specifies destination directory, where the backup file will be stored.<\/li>\n<li><code>-c<\/code>\u00a0\u2013 defines the compression utility.<\/li>\n<li><code>-u<\/code>\u00a0\u2013 allows for reading additional tar\/rsync options.<\/li>\n<\/ul>\n<pre>$ sudo .\/star.sh -i 0 -d \/backups -c xz -u \"--warning=none\"\r\n<\/pre>\n<div id=\"attachment_28939\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Perform-Linux-System-Backup.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28939\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/Perform-Linux-System-Backup.png\" alt=\"Perform Linux System Backup\" width=\"754\" height=\"587\" aria-describedby=\"caption-attachment-28939\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28939\" class=\"wp-caption-text\">Perform Linux System Backup<\/p>\n<\/div>\n<p>To exclude the\u00a0<code>\/home<\/code>\u00a0in the backup, add the\u00a0<code>-H<\/code>\u00a0flag, and use\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-compress-decompress-bz2-files-using-bzip2\/\" target=\"_blank\" rel=\"noopener\">gzip compression utility<\/a>\u00a0as shown.<\/p>\n<pre>$ sudo .\/star.sh -i 0 -d \/backups -c gzip -H -u \"--warning=none\"\r\n<\/pre>\n<h4>Restore Linux System Backup<\/h4>\n<p>You can also restore a backup as in the following command.<\/p>\n<pre>$ sudo .\/star.sh -i 1 -r \/dev\/sdb1 -G \/dev\/sdb -f \/backups\/backup.tar.xz\r\n<\/pre>\n<p>where the option are:<\/p>\n<ul>\n<li><code>-i<\/code>\u00a0\u2013 specifies operation mode (<strong>1<\/strong>\u00a0meaning restore mode).<\/li>\n<li><code>-r<\/code>\u00a0\u2013 defines targeted root\u00a0<strong>(\/)<\/strong>\u00a0partition.<\/li>\n<li><code>-G<\/code>\u00a0\u2013 defines the grub partition.<\/li>\n<li><code>-f<\/code>\u00a0\u2013 specified the backup file path.<\/li>\n<\/ul>\n<p>The final example show how to run it in transfer mode (<strong>2<\/strong>). The new option here is\u00a0<code>-b<\/code>, which sets the boot partition.<\/p>\n<pre>$ sudo .\/star.sh -i 2 -r \/dev\/sdb2 -b \/dev\/sdb1 -G \/dev\/sdb\r\n<\/pre>\n<p>In addition, if you have mounted\u00a0<strong>\/usr<\/strong>\u00a0and\u00a0<strong>\/var<\/strong>\u00a0on separate partitions, considering the previous command, you can specify them using the\u00a0<code>-t<\/code>\u00a0switch, as shown.<\/p>\n<pre>$ sudo .\/star.sh -i 2 -r \/dev\/sdb2 -b \/dev\/sdb1 -t \"\/var=\/dev\/sdb4 \/usr=\/dev\/sdb3\" -G \/dev\/sdb\r\n<\/pre>\n<p>We have just looked a few basic options of\u00a0<strong>System Tar and Restore<\/strong>\u00a0script, you can view all available options using the following command.<\/p>\n<pre>$ star.sh --help \r\n<\/pre>\n<p>If you are accustomed to graphical user interfaces, you can use the GUI wrapper\u00a0<strong>star-gui.sh<\/strong>\u00a0instead. But you need to install\u00a0<strong>gtkdialog<\/strong>\u00a0\u2013 used to create graphical (GTK+) interfaces and dialog boxes using shell scripts in Linux.<\/p>\n<div id=\"attachment_28940\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/System-Tar-and-Restore-Gui.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28940\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/03\/System-Tar-and-Restore-Gui.png\" alt=\"System Tar and Restore Gui\" width=\"543\" height=\"692\" aria-describedby=\"caption-attachment-28940\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28940\" class=\"wp-caption-text\">System Tar and Restore Gui<\/p>\n<\/div>\n<p>You can find more command-line usage examples from the\u00a0<strong>System Tar and Restore<\/strong>\u00a0Github repository:\u00a0<a href=\"https:\/\/github.com\/tritonas00\/system-tar-and-restore\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/tritonas00\/system-tar-and-restore<\/a>.<\/p>\n<h5>Summary<\/h5>\n<p><strong>System Tar and Restore<\/strong>\u00a0is a simple yet powerful, and versatile system backup script for Linux systems. Try it out comprehensively and share your thoughts about it via the feedback form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/system-tar-and-restore-a-linux-backup-script\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System Tar and Restore\u00a0is a versatile system backup script for Linux systems. It comes with two bash scripts, the main script\u00a0star.sh\u00a0and a GUI wrapper script\u00a0star-gui.sh, which perform in three modes:\u00a0backup,\u00a0restore\u00a0and\u00a0transfer. Read Also:\u00a014 Outstanding Backup Utilities for Linux Systems Features Full or partial system backup Restore or transfer to the same or different disk\/partition layout. Restore &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/system-tar-and-restore-a-versatile-system-backup-script-for-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;System Tar and Restore \u2013 A Versatile System Backup Script for Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13377","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13377"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13377\/revisions"}],"predecessor-version":[{"id":13378,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13377\/revisions\/13378"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}