2

I tried to ignore some files that end with ".NUMBERS" like .133443. I tried this Regex but it still copies the files:

unison -batch -owner -group -times -ignore "Regex ^*\.[0-9]+$" /hadoop/bigdata/giin/data ssh://cnp31ginhortonen1.giin.recouv//hadoop/bigdata/giin/data -prefer newer`

Source :

[root@cnp31ginhortonen1 .unison]# tree /hadoop/bigdata/giin/data/ 

/hadoop/bigdata/giin/data/
├── aefd.csv
├── aefd.log
├── aefd.xml
├── subdir
│   ├── aefd.csv
│   ├── aefd.log
│   ├── aefd.xml
│   └── TB5E.B01.117.210409074
├── TB5E.B01.117.10409074
└── TB5E.B01.117.210409074
Andy A.
  • 1,392
  • 5
  • 15
  • 28
anis
  • 21
  • 1
  • 1
    There is an error in your regular expression. You likely meant to write: `^.*\.[0-9]+$`. Note the dot _before_ the asterisk. Another tip: Is there any way you could make your regular expression more specific? Like leading subdirectories, double file extensions (I note you have multiple file extensions in your example), ... As it is written, your regular expression will make `unison` skip man pages (extensions `.1`, `.2`, ...), and perhaps other files you didn't mean to skip (backups, data files, ...). – Edward May 11 '21 at 06:05
  • thanks your regex worked :) `^.*\.[0-9]+$` – anis May 21 '21 at 11:49

0 Answers0