Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Uploading files with LFTP by date

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

Suggested Solutions

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.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

856 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