Solved

Uploading files with LFTP by date

Posted on 2010-11-19
8
1,062 Views
Last Modified: 2013-12-09
Every day my web server generates a series of files with the following format:
AA-BB-YYYYMMDD.txt. For example: CA-FR-20101119.txt

The generated files are being stored in a directory. Until now, I synchronize it with the remote server using mput -c, uploading any files that have changed. However, the files in the remote server are moved once uploaded, so each day the script upload all the files back again.

I need to upload (syncronize) only the current day files, but for the date in the filename.

I am using the following script:

#!/bin/sh
USERNAME="username"
PASSWORD="password"
SERVER="10.10.10.10"

# local directory to pickup files
FILES="/var/www/html/CA-*.txt"

# remote server directory to upload files
UPLOADIR="/destination"

# login to remote server
lftp -u ${USERNAME},${PASSWORD} ${SERVER} << CMD
cd ${UPLOADIR}
mput -c ${FILES}
bye

Thank you very much for your help.
0
Comment
Question by:cgarreta
  • 3
8 Comments
 

Author Comment

by:cgarreta
ID: 34222720
One way to simplify the question will be... Can I synchronize with the remote server only the current day files?
I don't know if it is possible using a LFTP command.
Thank you.
0
 

Author Comment

by:cgarreta
ID: 34276592
Thanks Jon. Could you delete this post or move it to the correct zone?
0
 

Accepted Solution

by:
cgarreta earned 0 total points
ID: 34301770
Thank you. Finally I solve the problem moving the old files to another directory and sincronizing only the current day files.
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 34308012
Can you post your exact solution for others to read?

Thanks,
-Jon
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Let’s list some of the technologies that enable smooth teleworking. 
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now