LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   lftp mirror regular expression problem (https://www.linuxquestions.org/questions/linux-software-2/lftp-mirror-regular-expression-problem-4175599183/)

horizn 02-07-2017 07:36 AM

lftp mirror regular expression problem
 
Hi,
I am trying to force lftp to mirror only .bin files from folders beginning from 11. and 14., but not older than 1 day. What I have so far is:

Code:

mirror -i "(14.*|11.*)$\.bin" --newer-than=now-1days --no-empty-dirs --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR;
I also tested:
Code:

mirror -i ^14.*\.bin$ -i ^11.*\.bin$ --newer-than=now-1days --no-empty-dirs --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR;
Unfortunately it download only .bin files from folders 11.*
Do anyone have idea what should I change?

AwesomeMachine 02-07-2017 07:14 PM

You could try using rsync.

syg00 02-07-2017 07:28 PM

Why do you have an anchor in the middle of the first regex ?.
Without testing in lftp I might be inclined to try something like
Code:

mirror -i "^1[14].*\.bin$" --newer-than=now-1days --no-empty-dirs --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR;

horizn 02-08-2017 03:48 AM

Quote:

Originally Posted by AwesomeMachine (Post 5666842)
You could try using rsync.

For some reasons no. Remote site is quite rubbish and I don't have full control over it.

horizn 02-13-2017 03:37 PM

Quote:

Originally Posted by syg00 (Post 5666849)
Why do you have an anchor in the middle of the first regex ?.
Without testing in lftp I might be inclined to try something like
Code:

mirror -i "^1[14].*\.bin$" --newer-than=now-1days --no-empty-dirs --use-pget-n=10 $REMOTE_DIR $LOCAL_DIR;

Thanks, that worked.


All times are GMT -5. The time now is 08:40 PM.