raspi backup and restore
This commit is contained in:
11
.project
Normal file
11
.project
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>hacking_spielplatz</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
1
SQL-Scrapbook2
Normal file
1
SQL-Scrapbook2
Normal file
@@ -0,0 +1 @@
|
||||
update users set extern_uid='cn=Michael Rausch,ou=people,dc=maketank,dc=net', provider='ldap' where username = 'mrausch';
|
||||
24
raspbmc-backup-fresh.sh
Executable file
24
raspbmc-backup-fresh.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
#backup a raspbmc host:
|
||||
MNT=/mnt
|
||||
SRC=/dev/mmcblk0
|
||||
TO=~do/Documents/Backups/${1}
|
||||
TSTAMP=$(date +%Y-%m-%d)
|
||||
|
||||
TAR="/bin/tar --sparse --same-owner --preserve-permissions \
|
||||
-C $MNT --use-compress-program /usr/bin/pbzip2 -c"
|
||||
|
||||
mount ${SRC}p2 /mnt
|
||||
mount ${SRC}p1 /mnt/boot
|
||||
|
||||
#prep ENV!
|
||||
cp -uv /usr/bin/qemu-arm-static ${MNT}/usr/bin
|
||||
#get selections
|
||||
chroot ${MNT} dpkg --get-selections |grep -v deinstall >${MNT}/etc/dpkg/package-selections
|
||||
|
||||
${TAR} -f ${TO}/${TSTAMP}_fresh.tar.bz2 /mnt/*
|
||||
|
||||
# finish
|
||||
umount /mnt/boot
|
||||
umount /mnt
|
||||
31
raspbmc-restore.sh
Executable file
31
raspbmc-restore.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
#backup a raspbmc host:
|
||||
MNT=/mnt
|
||||
SRC=/dev/mmcblk0
|
||||
TO=~do/Documents/Backups/${1}
|
||||
TSTAMP=${2}
|
||||
|
||||
TAR="/bin/tar --wildcards --sparse --same-owner --preserve-permissions \
|
||||
-C $MNT --use-compress-program /usr/bin/pbzip2 -xv"
|
||||
|
||||
mount ${SRC}p2 /mnt
|
||||
mount ${SRC}p1 /mnt/boot
|
||||
|
||||
#prep ENV!
|
||||
cp -uv /usr/bin/qemu-arm-static ${MNT}/usr/bin
|
||||
#get selections
|
||||
#chroot ${MNT} dpkg --get-selections |grep -v deinstall >${MNT}/etc/dpkg/package-selections
|
||||
|
||||
${TAR} --exclude=".xbmc/temp/*" -f ${TO}/${TSTAMP}_home_pi.tar.bz2 home/pi
|
||||
${TAR} -f ${TO}/${TSTAMP}_boot.tar.bz2 boot/*config*
|
||||
${TAR} -f ${TO}/${TSTAMP}_etc.tar.bz2 etc/passwd
|
||||
${TAR} -f ${TO}/${TSTAMP}_etc.tar.bz2 etc/group
|
||||
${TAR} -f ${TO}/${TSTAMP}_etc.tar.bz2 etc/ssh/*
|
||||
${TAR} -f ${TO}/${TSTAMP}_etc.tar.bz2 etc/apt/*
|
||||
${TAR} -f ${TO}/${TSTAMP}_etc.tar.bz2 etc/dpkg/*
|
||||
${TAR} -f ${TO}/${TSTAMP}_etc.tar.bz2 etc/host*
|
||||
|
||||
# finish
|
||||
umount /mnt/boot
|
||||
umount /mnt
|
||||
6
sql-playground.sql
Normal file
6
sql-playground.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
# gitlab stuff;
|
||||
select * from users where name like 'heiko%';
|
||||
|
||||
update users set username = 'hhaller' where username = 'heikohaller';
|
||||
|
||||
select login,firstname,lastname,mail from users where status = 1;
|
||||
Reference in New Issue
Block a user