Avatar of rafaelrgl
rafaelrgl

asked on 

lftp to sync folders but do not keep files older than 30 days old on synced machine.

here is what I did:

lftp ftp://ftp.server.com <<- DOWNLOAD
    user user@ftp.com "password"
    set ssl:verify-certificate no
    mirror -cn / /localfolder;
    bye
DOWNLOAD

this script works perfect to get the root folder on the ftp and sync with local folder, but here is what I want to accomplish now. I want to keep in my local folder only files that are newer than 30 days old base on the creation date of the file. So here is the example. lets say we run the script, the script will go to the ftp and download only the files that are newer than 30 days old and we do not have it inside the local folder and we will delete files older than 30 days on local folder. How can I accomplish this?
LinuxShell Scripting

Avatar of undefined
Last Comment
rafaelrgl
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of rafaelrgl
rafaelrgl

ASKER

perfect. works like its suppose to. thanks
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo