You are not logged in.

#1 2019-04-09 13:08:04

rogerthat
Member
Registered: 2016-11-15
Posts: 56

System backup using tar

I saw a how-to online about making a system backup. Wondering if this script below will actually work?
(Assume that I'm not running any programs and generally have the system idling when I run it.)

And if used, how would I actually restore a backup from it?
I'm guessing format the system volume clean, boot from a liveCD and run the (un)tar command onto that clean volume?

Thanks!

#!/bin/sh

sudo -v
mount /mnt/usb

# CLEAN UP FILESYSTEM HISTORY
sudo truncate -s0 /root/.bash_history
sudo truncate -s0 /root/.lesshst
truncate -s0 /home/myname/.bash_history
truncate -s0 /home/myname/.lesshst

sudo tar cvpfz /mnt/usb/backup.tgz --exclude=/lost+found/* --exclude=/mnt/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/swapfile --exclude=/home/myname/.cache/* / | tee /mnt/usb/backup.log

umount /mnt/usb

Offline

#2 2019-04-09 13:15:30

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Offline

#3 2019-04-09 13:31:33

loqs
Member
Registered: 2014-03-06
Posts: 19,101

Re: System backup using tar

https://bbs.archlinux.org/viewtopic.php?pid=1685075 gnu tar still does not support capabilities.

Offline

Board footer

Powered by FluxBB