상태. USB2를 통해 하드 드라이브 백업(예, 약간 느림)
Udev-Rules /media/partition-label에 /home-backup 파티션을 마운트합니다(사용자 1명만 해당).
/dev/sdb2 on /media/debianhome type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
` udev-rule은 내가 만든 systemd-unit을 트리거합니다.
cat /etc/systemd/system/backup-home-skript.service
[Unit]
Description=backup-home-skript
RequiresMountsFor=/media/debianhome
After=media-debianhome.mount
[Service]
Type=simple
User=alex
ExecStart=/usr/local/bin/backup-home-skript
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=15s
여태까지는 그런대로 잘됐다.
systemctl status backup-home-skript.service
● backup-home-skript.service - backup-home-skript
Loaded: loaded (/etc/systemd/system/backup-home-skript.service; static; vendor preset: enabled)
Active: active (running) since Wed 2017-11-08 16:04:41 CET; 4h 26min ago
Main PID: 23143 (backup-home-skr)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/backup-home-skript.service
├─23143 /bin/bash /usr/local/bin/backup-home-skript
├─23191 rsync -aAXEovvchx --ignore-existing --verbose --exclude=/home/alex/iso-image/ --exclude=/home/alex/.cache/ --excl
├─23192 rsync -aAXEovvchx --ignore-existing --verbose --exclude=/home/alex/iso-image/ --exclude=/home/alex/.cache/ --excl
└─23404 rsync -aAXEovvchx --ignore-existing --verbose --exclude=/home/alex/iso-image/ --exclude=/home/alex/.cache/ --excl
Nov 08 16:04:41 Taomon systemd[1]: Started backup-home-skript.
백업 홈페이지 스크립트
cat /usr/local/bin/backup-home-skript
#!/bin/bash
echo "wating for device to become ready" >> /home/alex/rsync.log
/bin/sleep 45
while ! \
rsync -aAXEovvchx --ignore-existing --verbose \
--exclude=/home/alex/iso-image/ \
--exclude=/home/alex/.cache/ \
--exclude=/home/alex/.thumbnails/ \
--exclude=/home/alex/rsync.log \
/home/alex/ /media/debianhome/alex >> /home/alex/rsync.log
do
sleep 60
echo "retrying" >> /home/alex/rsync.log
done
/usr/bin/aplay -q /home/alex/Musik/Wave/game-over.wav
echo "rsync done" >> /home/alex/rsync.log
exit 0
rsync가 2시간 동안 여기에 멈췄습니다.
tail -n10 rsync.log
send_files mapped /home/alex/.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35CBBC56B8E501F758A3BED2CD20C52E5694F9E5 of size 53947
calling match_sums /home/alex/.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35CBBC56B8E501F758A3BED2CD20C52E5694F9E5
.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35CBBC56B8E501F758A3BED2CD20C52E5694F9E5
sending file_sum
false_alarms=0 hash_hits=0 matches=0
sender finished /home/alex/.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35CBBC56B8E501F758A3BED2CD20C52E5694F9E5
send_files(13899, /home/alex/.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35ED5D22AB261A928FEA2B5079701D5DF254CF71)
send_files mapped /home/alex/.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35ED5D22AB261A928FEA2B5079701D5DF254CF71 of size 17369
calling match_sums /home/alex/.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35ED5D22AB261A928FEA2B5079701D5DF254CF71
.cache/mozilla/firefox/tv7fce7g.default/cache2/entries/35ED5D22AB261A928FEA2B5079701D5DF254CF71
rsync가 수행하는 작업을 이해하지 못합니다. 하지 마십시오. 배제는 모든 것이 해결되도록 놔두는 것을 의미합니까? 때로는 작동하지만 때로는 작동하지 않습니다.dmesg 필터
/usr/local/bin/backup-home-skript 또는 내 systemd-unit에 문제가 있습니까? 모든 관련 정보를 제공했으면 좋겠습니다.
새로운 시도.
rsync -aAXEovvvchxs --ignore-existing \
--exclude={iso-image,*cache*,*thumb*,rsync.log*,.*}
이제는 이미지로 막혔습니다.
mediainfo enna/enna-0.4.0/data/theme/default/images/unknown_cover.png
General
Complete name : enna/enna-0.4.0/data/theme/default/images/unknown_cover.png
Format : PNG
Format/Info : Portable Network Graphic
File size : 217 KiB
Image
Format : PNG
Format/Info : Portable Network Graphic
Width : 600 pixels
Height : 600 pixels
Bit depth : 32 bits
Compression mode : Lossless
Stream size : 217 KiB (100%)
이제 smartmontools를 사용할 차례입니다.
답변1
죄송합니다. 결과적으로 하드웨어 오류가 발생했습니다.
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 10% 1145 1887144880 - 168
`