rsync does all that and more... here is an example... most of the hieroglyphics are necessary I'm afraid... The file/directory list can also be in a separate file....
#!/bin/bash
rsync -avH --filter="merge -" --prune-empty-dirs /well/source/ /archive/dest/ << EOF
+ /User1/***
+ /Data1/stuart/***
+ /Data1/gru/***
+ /Data1/vector/***
+ /andrew/***
+ /reports/A01_v2/***
+ /reports/A01_v3/***
+ /reports/A03_v1/***
+ /reports/Auto_Control/***
+ /reports/Auto_GS12/***
+ /reports/Auto_OX13/***
+ /reports/Auto_OX14/***
+ /reports/VICTOR/***
+ /reports/control/***
+ /colin/***
+ /fred/***
+ /gavin/***
+ /neil/***
+ /nikos/MEN1/***
+ /sam/dir003/***
+ /sam/dir006/***
+ /sam/dir063/***
+ */
- *
EOF
--
Dr. Robert Esnouf,
University Research Lecturer,
Head of Research Computing Core,
NDM Research Computing Strategy Officer
Room 10/028, Wellcome Trust Centre for Human Genetics,
Old Road Campus, Roosevelt Drive, Oxford OX3 7BN, UK
Email: [log in to unmask] / [log in to unmask]
Tel: (+44) - 1865 - 287783
---- Original message ----
>Date: Thu, 30 Jul 2015 23:00:53 +0100
>From: CCP4 bulletin board <[log in to unmask]> (on behalf of Mohamed Noor <[log in to unmask]>)
>Subject: [ccp4bb] Off-topic: Transfering data from Diamond
>To: [log in to unmask]
>
>Dear all
>
>I have about 70 folders of data collected at Diamond. As I only want to keep about 50 of them, is there a script that can read in the folder names from a text file and download those?
>
>Normally, I use FileZilla but it gets tedious to click so many times after a while....
>
>Secondly, some folders have one sweep of data, some others with two or even three, is it possible to run a command from terminal that will filter different sweeps and output the number of frames?
>
>For example, in a folder with files:
>
>xxxx_sweep1_0001.cbf - xxxx_sweep1_1800.cbf
>xxxx_sweep2_0001.cbf - xxxx_sweep2_0900.cbf
>
>I want to get a text file output containing a line saying:
>/folder/name/sweep1 - 1800
>/folder/name/sweep2 - 900
>
>The idea is so that I can feed those lines into XDS.INP without checking how many sweeps there are in each folder and how many frames.
>
>I'm pretty sure someone on the BB has a trick for this.
>
>Thanks.
|