Whatsup - לינוקס, תוכנה חופשית וקוד פתוח בעברית

תיכנות בלינוקס - למה rsync לא רץ

מייקי - 08/12/2016 - 16:55
נושא ההודעה: למה rsync לא רץ
שלום,
ברשותי ארץ' עדכני.
אני רוצה לגבות קבצי תמונות שצולמו מתאריך מסוים ואילך באמצעות rsync.
לשם כך תחילה השתמשתי ב find למציאת הקבצים שעונים לתנאי, ואז, לאחר שאני מוודא שאני במחיצה המתאימה, אני מנסה להריץ את rsync- אלא שה לא רץ משום מה.

רצ"ב הפלטים הרלוונטיים- אשמח לעזרה.

תודה מראש מייקי

מבנה המחיצות הרלוונטיות ופקודת ה rsync

קוד:


$ pwd
/run/media/miki2/Photos/Photos/2016
[miki2@Miki_Desk 2016]$ cd ..
[miki2@Miki_Desk Photos]$ rsync  --files-from=/home/miki2/newfiles.txt -av /run/media/miki2/Photos/TMP/   
rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.


--------------------------------------------------

מבנה המחיצות תחת Photos
קוד:

 2016
│   ├── 2016-01-05_Sunsets
│   ├── 2016-01-11_Sunset
│   ├── 2016-01-21
│   ├── 2016-01-22
│   ├── 2016-01-23
│   ├── 2016-01-28_Family_Acre
│   ├── 2016-01-30_Ziv
│   ├── 2016-01-31


---------------------

---ולבסוף רשימת קבצי התמונות לגיבוי----------------------------
קוד:

$ cd ~
[miki2@Miki_Desk ~]$ cat newfiles.txt |more
./2016/2016-02-12_Jeen_R/Jeen-0774-20160212.jpg
./2016/2016-02-12_Jeen_R/Jeen-0900-20160212.jpg
./2016/2016-02-12_Jeen_R/Jeen-0950-20160212.jpg
./2016/2016-02-12_Jeen_R/Jeen-0964-20160212.jpg
./2016/2016-02-12_Jeen_R/Jeen-1030-20160212.jpg
./2016/2016-02-12_Jeen_R/Jeen-1084-20160212.jpg
..

Anonymous - 08/12/2016 - 17:13
נושא ההודעה:
מה תוכן הקובץ? האם השמות שם הם בנתיב מלא?
למה להשתמש בקובץ ? לסינון קבצים?
Anonymous - 08/12/2016 - 17:14
נושא ההודעה:
פיספסתי את הסיפא שלך.
אז כן, נסה נתיב מלא.
מייקי - 08/12/2016 - 17:26
נושא ההודעה: תודה אבל
תודה שעיר (גם על הזריזות..) אבל:
1. המדובר בכונן חיצוני עליו המקורות, ואני לא! רוצה שכל הירככית הקבצים (/run/media/user... וכו') תופיע בגיבוי- לכן במפורש בחרתי שמות יחסיים, והקפדתי לעבור למחיצה הנכונה לפני הרצת ה rsync
2. אני מסנן את רשימת הקבצים, כי לכל תחום תאריכים יש לי יעד גיבוי שונה (בהמשך, לאחר שזה יעבוד, אמיר זאת לסקריפט BASH).


עוד רעיונות?

תודה מראש לעונים
Anonymous - 08/12/2016 - 17:35
נושא ההודעה:
נסה להריץ תיקיה אחת כ source ללא קובץ שמות על מנת שנדע ששם באמת הבעיה.
כמו כן P- נותן לך גם verbose (כמו v-) ואינדיקציה לגבי ההתקדמות. יש התקדמות?
מייקי - 08/12/2016 - 17:52
נושא ההודעה: נראה שהבעיה ברשימת הקבצים
תודה שעיר..

עשיתי כעצתך ועובד כמו שעון (ראה פלט) - כלומר הבעיה ברשימת הקבצים- אבל מהיא בדיוק?

תודה

--------------פלט רלוונטי------------
קוד:



$ pwd                                                                                                                                                                   
/run/media/miki2/Photos/Photos/2016                                                                                                                                                           
[miki2@Miki_Desk 2016]$ rsync 2016-01-05_Sunsets/ -av  /run/media/miki2/Photos/TMP                                                                                                            
sending incremental file list                                                                                                                                                                 
./                                                                                                                                                                                            
Sunset-0014-20160105.dng                                                                                                                                                                      
Sunset-0015-20160105.dng


Anonymous - 08/12/2016 - 18:14
נושא ההודעה:
גררת אותי יחד איתך עם הנחה מוטעית.
את השלבים אשר הצעתי (ואציע) לך לבצע היית אמור לבצע לבד לפי הגיון פשוט.
אז השלב הבא הוא לתת נתיב מלא לקובץ אחד ברשימה.
אני אחסוך לך - הוא לא יועתק עם הנתיב המלא.
למעשה תצטרך להתאמץ כדי שהוא כן יועתק לפי הנתיב במקור (כך לפחות לפי הבנת הנקרא שלי. ט.ל.ח) -

קוד:
       -r, --recursive
              This tells rsync to copy directories recursively.  See also --dirs (-d).

              Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after  the  scanning  of
              the  first few directories have been completed.  This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer.  It is also only
              possible when both ends of the transfer are at least version 3.0.0.

              Some options require rsync to know the full file list, so  these  options  disable  the  incremental  recursion  mode.   These  include:  --delete-before,  --delete-after,
              --prune-empty-dirs, and --delay-updates.  Because of this, the default delete mode when you specify --delete is now --delete-during when both ends of the connection are at
              least 3.0.0 (use --del or --delete-during to request this improved deletion mode explicitly).  See also the --delete-delay option  that  is  a  better  choice  than  using
              --delete-after.

              Incremental recursion can be disabled using the --no-inc-recursive option or its shorter --no-i-r alias.

מייקי - 08/12/2016 - 22:09
נושא ההודעה: תודה
אבדוק מחר
מייקי - 09/12/2016 - 22:03
נושא ההודעה: תודה לשועל
תודה שועל,


בזכות שאלותיך הבנתי שהבעיה היתה ברשימת הקבצים.
החלטתי "לעקוף" את הבעיה באופן הבא:

קוד:

cd /run/media/miki2/Photos/Photos
find . -type f -newermt 20160901 -exec rsync -avR --relative {} /run/media/miki2/Archieve04_Mrr

כל הזמנים הם GMT + 2 שעות