Discussion:
Mirror to remote except particular folder present on remote
Nicolas Raoul
2014-06-19 12:15:11 UTC
Permalink
Hello all,

I usually edit my website locally and push it with this command:

lftp -u user,password host -e "mirror -c -e -R -x ^\.git/$ my /my; exit"

But now, my website dynamically adds data to the /my/data/ folder.

I don't have this /my/data folder locally.

*QUESTION:* How to push without deleting/overwriting /my/data and its
content?

Notes:

- I could download /my/data and then run the command above, but data
added in the few seconds before the download and the upload would get lost.
- For the other files/folders, local deletion should be mirrored by a
remote deletion.
- I don't want to use --only-newer-like operations because clocks might
not be adjusted.

Thanks a lot!
Nicolas Raoul

PS: Originally asked at http://unix.stackexchange.com/q/119458 but no
answer there...
Alexander V. Lukyanov
2014-06-19 13:19:15 UTC
Permalink
Post by Nicolas Raoul
Hello all,
lftp -u user,password host -e "mirror -c -e -R -x ^\.git/$ my /my; exit"
But now, my website dynamically adds data to the /my/data/ folder.
I don't have this /my/data folder locally.
*QUESTION:* How to push without deleting/overwriting /my/data and its
content?
Just exclude the folder using -x ^data/ option.

If you need to upload some local files into that folder, use two mirrors,
one without -e option just for my/data folder.
--
Alexander.
Loading...