troubleshooting Question

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

Avatar of rafaelrgl
rafaelrgl asked on
LinuxShell Scripting
2 Comments1 Solution728 ViewsLast Modified:
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?
ASKER CERTIFIED SOLUTION
nociSoftware Engineer
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros