Difference between revisions of "NUC Backup"
From wikidb
(→Backup Files) |
(→Backup Files) |
||
Line 55: | Line 55: | ||
/home/epp/.ssh/known_hosts updated. | /home/epp/.ssh/known_hosts updated. | ||
Original contents retained as /home/epp/.ssh/known_hosts.old | Original contents retained as /home/epp/.ssh/known_hosts.old | ||
+ | |||
+ | == Copy to adams == | ||
+ | |||
+ | On adams | ||
+ | |||
+ | $ pwd | ||
+ | /home/eepp/dbbackups/wikidb | ||
+ | |||
+ | $ scp epp@10.0.0.9:dbbackup/dbbackups/wikidb/wiki-20240624T0004.tgz . | ||
+ | epp@10.0.0.9's password: | ||
+ | wiki-20240624T0004.tgz | ||
+ | |||
+ | $ scp epp@10.0.0.9:dbbackup/dbbackups/wikidb/wikidb-20240624T0004.sql.gz . | ||
+ | epp@10.0.0.9's password: | ||
+ | wikidb-20240624T0004.sql.gz 100% 23MB 5.4MB/s 00:04 | ||
== rsync == | == rsync == |
Revision as of 19:07, 23 June 2024
Contents
Steps
$ ssh epp@10.0.0.9
$ sudo mount /dev/sdb1 /media/backup $ cd /media/backup/
If it fails, do it a second time.
$ source rainier_backup.sh tar: Removing leading `/' from member names tar: Removing leading `/' from member names
$ cd $ cd dbbackup/
zdome MediaWiki
$ ls dbbackups/wikidb/ wiki-20200124T2021.tgz wikidb-20200124T2021.sql.gz
$ cd $ sudo umount /media/backup/ $ exit logout Connection to 10.0.0.9 closed.
Backup Files
Location on the backup disk
rainier's Mediawicky
$ pwd /media/backup/rainier/home/epp/dbbackup/dbbackups/wikidb
Hood and Rainer sync directories
$ pwd /media/backup/hoodcd
$ pwd /media/backup/rainier
These notes will help with a known hosts problem.
$ ssh-keygen -f "/home/epp/.ssh/known_hosts" -R 10.0.0.111 # Host 10.0.0.111 found: line 1 type ECDSA /home/epp/.ssh/known_hosts updated. Original contents retained as /home/epp/.ssh/known_hosts.old
Copy to adams
On adams
$ pwd /home/eepp/dbbackups/wikidb $ scp epp@10.0.0.9:dbbackup/dbbackups/wikidb/wiki-20240624T0004.tgz . epp@10.0.0.9's password: wiki-20240624T0004.tgz
$ scp epp@10.0.0.9:dbbackup/dbbackups/wikidb/wikidb-20240624T0004.sql.gz . epp@10.0.0.9's password: wikidb-20240624T0004.sql.gz 100% 23MB 5.4MB/s 00:04
rsync
- Backup the wiki NUC_Web#Backup_zdome
- No backup the NUC. See below for creating the backup disk.
sudo mount /dev/sdb1 /media/backup cd /media/backup sudo rsync -ax /home . sudo umount /media/backup
Other rsync examples
rsync -ax / /media/cd181ea6-154d-4070-ab22-bd4f5f5aa635/tabor120520 rsync -ax -exclude /home/eepp/scr/linux-source-2.6.32 … rsync -ax pi@10.0.0.161: pi
add --delete on future syncs
I dropped the auto mount and duplicity backup.
Sisters
cd /media/eepp/0c9f950a-f453-4993-b2c0-da69b5d3da1d/ mkdir sisters cd sisters/ sudo rsync -ax /home/ . sudo rsync -ax /opt/ .
Create the Backup Disk
Determine what disk are currently on the system. The Icy Dock disk is ext2 so it will be re-partitioned and formated
mount
or
sudo parted -l sudo parted /dev/sdbeepp@rainier:~$ sudo parted /dev/sdb GNU Parted 2.3 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? Yes (parted) print Model: WDC WD50 01AALS-00L3B2 (scsi) Disk /dev/sdb: 500GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags (parted) unit s (parted) mkpart primary 1M -1M (parted) quit Information: You may need to update /etc/fstab. eepp@rainier:~$ sudo mkfs.ext4 /dev/sdb1 mke2fs 1.42.9 (4-Feb-2014) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 30531584 inodes, 122096384 blocks 6104819 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 3727 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done eepp@rainier:~$ sudo tune2fs -r 0 /dev/sdb1 eepp@rainier:~$ sudo parted -l Model: ATA INTEL SSDMCEAW24 (scsi) Disk /dev/sda: 240GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 538MB 537MB fat32 boot 2 538MB 232GB 231GB ext4 3 232GB 240GB 8513MB linux-swap(v1) Model: WDC WD50 01AALS-00L3B2 (scsi) Disk /dev/sdb: 500GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 500GB 500GB ext4 primary eepp@rainier:~$ sudo mkdir /media/backup eepp@rainier:~$ sudo mount /dev/sdb1 /media/backup/
Note - If you are starting with a formated disk
- I right clicked in each partition and did a delete
- Repeated until everything was free space
- I then created one simple volumn
Mount at Boot
sudo mkdir /media/backup sudo chmod 777 /media # these were 755 sudo chmod 777 /media/backup
epp@rainier:/media/backup$ diff /etc/fstab /etc/fstab.org 14,19d13 < # < # backup < # < # UUID=0c9f950a-f453-4993-b2c0-da69b5d3da1d /media/backup ext4 user,fmask=0111,dmask=0000 0 0 < /dev/sdb1 /media/backup ext4 defaults,errors=remount-ro,noatime 0 0 <
See Asus_702_Eee_PC_ubuntu#Mount_.2Fusr
Backup
Duplicity
- Ran it from the Accessories menu
- Set storage location to "/media/backup"
- Set Scheduling to "Day"