sdcard backup tool added
This commit is contained in:
parent
08ac5c4c87
commit
503a2239c3
2 changed files with 22 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get dist-ugprade
|
sudo apt-get dist-ugprade
|
||||||
sudo apt-get install meld whois zsh tmux vim atop aria2 curl
|
sudo apt-get install meld whois zsh tmux vim atop aria2 curl pv pixz
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
$DIR/install_common.sh
|
$DIR/install_common.sh
|
||||||
|
|
21
tools/backup_sdcard.sh
Executable file
21
tools/backup_sdcard.sh
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z $1 ]]; then
|
||||||
|
echo "usage: $0 device_to_clone"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
device=$1
|
||||||
|
|
||||||
|
timestamp=`date +%Y%M%d`
|
||||||
|
dest_file="/tmp/$timestamp.dd.xz"
|
||||||
|
|
||||||
|
echo "about to clone $device to $dest_file"
|
||||||
|
echo "ctrl-c or [enter]"
|
||||||
|
read
|
||||||
|
|
||||||
|
umount $device?
|
||||||
|
umount $device
|
||||||
|
|
||||||
|
sudo pv -tpreb $device | dd bs=4M | pixz > $dest_file
|
||||||
|
|
Loading…
Reference in a new issue