Hi, I’m new to managing a server and am trying to use lsync to allow a user to SFTP files into a folder here: /var/sftp/uploads
That automatically syncs with a folder in my public web folder. I set up the user using the following: https://www.digitalocean.com/community/questions/trying-to-setup-a-sftp-user-with-limited-access
This worked great, I then set up the lsync using: https://www.digitalocean.com/community/tutorials/how-to-mirror-local-and-remote-directories-on-a-vps-with-lsyncd
This worked great for syncing, but I would like to automatically set all files and directories to chmod 755 when the get synced to the web folder. From the tutorial I believe it would be via rsyncOpts, however from other reading for versions of lsyncd 2.1 and above this is no longer supported (I am running 2.1.5) and should be via rsync = {
From there I get lost, can anyone provide any support?
Thank you!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Going through the docs in the offical repo here:
https://github.com/lsyncd/lsyncd/blob/master/default-rsync.lua#L85
I think that you need to specify the following:
rsync = {
perms = true
}
Here is an example of the config that should work:
settings {
logfile = "/var/log/lsyncd.log",
statusFile = "/var/run/lsyncd.status"
}
sync {
default.rsync,
source = "/path/to/source",
target = "user@destination:/path/to/destination",
rsync = {
perms = true
}
}
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.