תודה חתול, אבל עדין הסקריפט לא עובד לי.
כשאני מנסה (כמשתמש miki ) להריץ אותו ובוחר 5 אני מקבל את הודעת השגיאה הבאה למרות שיש לי הרשאות.
תודה מראש על העזרה - פלטים רלוונטיים בהמשך.
מייקי
הודעת השגיאה
קוד: |
rsync: mkdir "/run/media/miki/Archieve03_Mrr" failed: Permission denied (13)
rsync error: error in file IO (code 11) at main.c(657) [Receiver=3.1.2]
sending incremental file list |
ההרשאות שלי
קוד: |
$ cd /run/media/miki/
miki /run/media/miki $ ls -al
total 4
drwxr-x---+ 3 root root 60 Mar 27 12:49 .
drwxr-xr-x 3 root root 60 Mar 27 12:49 ..
drwxrwxrwx 1 miki users 4096 Mar 27 12:54 Archieve03
|
והסקריפט עצמו
קוד: |
$ cat photos_sync
#!/bin/bash
read -p "Target: 1-Current, 2-Archieve02, 3-Archieve02_mirror, 4-Archieve03, 5-Archieve03_mirror " TARGET
echo
echo "selected $TARGET"
case $TARGET in
[1-1]*) DEST="/run/media/miki/Photos_Current/Photos"
;;
[2-2]*) DEST="/run/media/miki/Archv_02/Photos"
;;
[3-3]*) DEST="/run/media/miki/Arch_02_Mrr/Photos"
;;
[4-4]*) DEST="/run/media/miki/Archieve03/Photos"
;;
[5-5]*) DEST="/run/media/miki/Archieve03_Mrr/"
;;
esac
echo
case $TARGET in
[1-1]*) rsync -av --delete /photos/FB_Candidates /run/media/miki/Photos_Current
echo FB sync finished
echo
rsync -av --delete /photos/Photos/ /run/media/miki/Photos_Current/
echo current photos sync finished
echo
rsync -av --delete /photos/Scans /run/media/miki/Photos_Current
echo Scans sync finished
echo
#cp /photos/Lightroom/Lightroom\ 4\ 2013_Catalog-2.lrcat
#/run/media/miki/Photos_Current/Lightroom/Lightroom\ 4\ 2013_Catalog-2.lrcat
rsync -av --delete /photos/Lightroom/Backups/* /run/media/miki/Photos_Current/Lightroom/Backups/
echo LR sync finished
echo
;;
[4-4]*) find /photos/Photos -type f -newermt 20150529 -exec rsync -avR {} /run/media/miki/Archieve03/ \;
echo
;;
[5-5]*) find /photos/Photos -type f -newermt 20150529 -exec rsync -avR {} /run/media/miki/Archieve03_Mrr/ \;
echo
;;
esac
rsync -avR /photos/Photos/1983 $DEST
echo '1983 photos sync finished'
rsync -avR /photos/Photos/1986 $DEST
echo '1986 photos sync finished'
echo
|