LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-07-2017, 07:36 AM   #1
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 168

Rep: Reputation: Disabled
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?
 
Old 02-07-2017, 07:14 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
You could try using rsync.
 
Old 02-07-2017, 07:28 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,710

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
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;

Last edited by syg00; 02-07-2017 at 07:30 PM.
 
1 members found this post helpful.
Old 02-08-2017, 03:48 AM   #4
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 168

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
You could try using rsync.
For some reasons no. Remote site is quite rubbish and I don't have full control over it.
 
Old 02-13-2017, 03:37 PM   #5
horizn
Member
 
Registered: Jan 2015
Location: UK and Poland
Distribution: Slackware + Debian + Ubuntu
Posts: 168

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with lftp mirror exclude (cygwin) shortmort37 Linux - Software 0 09-03-2014 04:45 AM
[SOLVED] problem with regular expression ashok.g Programming 2 12-30-2009 06:05 AM
lftp mirror problem ycxbiao Linux - Software 1 09-27-2009 09:42 PM
lftp mirror problem crusher88 Linux - Software 2 08-14-2009 01:03 AM
Regular expression problem raghu123 Programming 11 10-12-2008 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration