Solved

Uploading files with LFTP by date

Posted on 2010-11-19
8
1,076 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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…

770 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