我從多個位置提取文件作爲發佈聚合服務的一部分。我需要一種方法將已經交付給我的文件從一個位置移動到另一個位置,而不會丟失用於排序目錄的目錄列表。有沒有辦法將文件從一組目錄移動到另一組相應的目錄
例子:
Filepath of delivery: Server/Vendor/To_Company/Customer_Name/**
Filepath of processing: ~/Desktop/MM-DD-YYYY/Returned_Files/Customer_Name/**
我知道我可以做一些事情,如把所有的目錄:
find Server/Vendor/To_Company/* -exec mv -n ~/Desktop/MM-DD-YYYY/Returned_Files \;
,但使用的是我只能每天運行腳本一次,並有是我可能需要多次運行它的時候。
看來理想情況下,我應該能夠在我的日常處理文件夾中創建一個副本目錄,然後將文件從一個文件移動到另一個文件夾。
謝謝,@neon!還有一個問題:我可以使用它排除一個目錄嗎?我正在閱讀大量的rsync手冊頁,並沒有看到我可以? –
用於提供'--dry-run'的+1,總是先測試一下吧! – grebneke
你可以使用 - 排除「PATTERN」選項。 http://stackoverflow.com/questions/8720234/rsync-exclude-not-excluding-specific-files – neon