On Sun, 27 Nov 2022 at 18:21, Piers Rowan via luv-main <[email protected]> wrote:
> One of my clients has a storage pattern of: > $number.$extension > So it looks like this: > 1.pdf > 2.pdf > 3.csv. > 4.jpg > . > $n.$ext > > (Where $n is a fairly large number). There was a job running that didn't > complete and I want to rsync only the files that they haven't got > already. Something like: > > # not an actual command > rsync /data/999999+.* user@host:/new_folder > > Any ideas would be very helpful. Hi Piers Although it has many options, one fundamental aspect of rsync is that by default it is designed to transfer only files (or even parts of files) that are not already present in the destination. A quick read of the first couple of paragraphs of 'man rsync' will confirm this aspect. It's one of the major reasons why people use it when they do. Assuming that there are no other files which should be excluded from the copy process (this aspect is important, but the problem specification omits that information), I suggest: rsync -v --dry-run /data/ user@host:/new_folder The trailing / at the end of /data/ specifies all files in the directory 'data', which will be copied into /new_folder --dry-run means show what would be done, but don't do anything. -v will show the names of each file. If the output of that looks correct, you can remove the --dry-run. If there are files that need to be excluded, then a different approach involving pattern-matching will be required. _______________________________________________ luv-main mailing list -- [email protected] To unsubscribe send an email to [email protected]
