Portál AbcLinuxu, 1. května 2025 19:04
#!/bin/bash # Copyright 2012 Tomas Lehocky tomas@LHC.sk # ======================================================================== # This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # You should have received a copy of the GNU General Public License along with this program; # if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ======================================================================== # notify-send, gtrayicon, gtkdialog # () {} [] # `` '' "" # . , : ; # @ $ € & # % ? ! # + - * = # _ ‾ ^ ~ ° # / \ | ¦ # < > export DISPLAY=:0 appname=$(echo $0 | sed 's|.*\/\(.*\)|\1|') if [ $(pgrep -c $appname) -gt 1 ]; then echo "$appname is already running."; notify-send "$appname is already running."; exit 1; fi dnorm=$(date +'%Y-%m-0%d_%H-%M-%S') dunix=$(date '+%s') hm=$HOME runpath=$(echo $0) #appdir=/opt/ #cfgdir=$hm/. pid=$(pgrep $appname) pidfile=/tmp/.$appname.$pid.pid startmsg="Zacala sa zaloha súborov na DVD-RAM." endmsg="Zaloha na DVD-RAM je dokoncena." cd /tmp echo "$appname=====================================================START" echo "$startmsg"; notify-send "$startmsg" blok=32768 #65536, 16384 device=/dev/sr0 mount=/tmp/.back_dvd_ram tg1=$mount/backup1 tg2=$mount/backup2 include=$mount/include.txt exclude=$mount/exclude.txt logfile=$mount/log.log template=$hm/zalohy/rucne/dvdram infofile=$mount/dvdram.info if [ ! -d "$mount" ]; then mkdir $mount; fi if [ ! -f "$infofile" ]; then sync; sudo mount -o rw,noatime,nodiratime,noexec,users,async $device $mount; fi if [ ! -f "$infofile" ]; then echo "Vlozili ste nespravne medium."; notify-send "Vlozili ste nespravne medium."; sudo umount -f $mount; exit 1 fi info=$(head -1 $infofile) if [ "$info" = "back1" ]; then cp -f -t $mount $template/dvd1/include.txt $template/dvd1/exclude.txt elif [ "$info" = "back2" ]; then cp -f -t $mount $template/dvd2/include.txt $template/dvd2/exclude.txt elif [ "$info" = "back3" ]; then cp -f -t $mount $template/dvd3/include.txt $template/dvd3/exclude.txt fi if [ ! -d "$tg1" ]; then mkdir $tg1; fi if [ ! -d "$tg2" ]; then mkdir $tg2; fi echo "$dnorm $dunix" > $mount/time.txt sudo dd if=/dev/sda of=$tg2/mbr_table_sda.img bs=446 count=1 #backup partition table sudo dd if=/dev/sda of=$tg2/mbr_full_sda.img bs=512 count=1 #backup partition table and bootloader sudo tar cpzf $tg2/etc.tgz /etc ls -Rhs $hm/audio > $tg2/audio_backup.txt ls -Rhs $hm/video > $tg2/video_backup.txt rsync -a --block-size=32768 --log-file=$logfile --exclude-from=$exclude $(cat $include) $tg1 sleep 2; sync; sleep 2; #sudo umount -f $mount echo "$endmsg"; notify-send "$endmsg" echo "$appname=======================================================END" if [ -f "$pidfile" ]; then rm -f $pidfile; fi
Tiskni
Sdílej:
Co tak nějaká pásková mechanika?
Ukáž Já si můžu maximálně tak vzít kazeťák a připojit ho k RS-232
No vidíš to, já bych ukládal na klasický kazety do kazeťáku Tam by se vyšlo (na ty 4 hodiny) tipuju tak pár desítek MB, podle způsobu ukládání. Zkoušet to asi nebudu, i když by se to dalo s pomocí osciloskopu hezky změřit a spočítat
ZIPky jsou myslím občas na aukru.
Tady http://jetset.blog.root.cz/2011/06/27/datchanger/ o tom něco je, hlavně v komentářích
Není zač
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.