Past Meetings

CLI Backups

 

Backup Documents with cpio

find Documents/ -depth -type f -print | cpio -ocv > /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Documents.cpio

To view contents of backup file:

cpio -vt /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Documents.cpio

 

Backup Pictures/ directory with cpio

find Pictures/ -depth -type f -print | cpio -ocv > /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Pictures.cpio

cpio -vt /run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Pictures.cpio

 

 

 

Backups with tar:

We can create a simple script for backups with tar:

cd bin/

vi tar_backup.sh

#!/bin/bash

BACKUPTIME=`date +%b-%d-%y` #get the current date

DESTINATION=/run/media/terry/3aaa1179-976c-4cac-b74c-5d41b713ffa6/Backups/Laptop/Documents-$BACKUPTIME.tar.gz

SOURCEFOLDER=/home/terry/Documents

tar -cpzf $DESTINATION $SOURCEFOLDER #create the backup

chmod +x tar_backup.sh

sh ~/bin/tar_backup.sh

tar -tf /path/to/Documents-01-2020.tar.gz