cgarreta
asked on
Uploading files with LFTP by date
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.
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-*.
# 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.
ASKER
Thanks Jon. Could you delete this post or move it to the correct zone?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you post your exact solution for others to read?
Thanks,
-Jon
Thanks,
-Jon
ASKER
I don't know if it is possible using a LFTP command.
Thank you.