Score:0

Auto sync folders on linux server

ru flag

My problem statement is how to auto sync /home/username/script folder to /var/www/html. So whenever files under script folder are updated then it will update them in destination folder, and also chown apache:apache & chmod 755. I tried using lsyncd and this is my conf file.

settings {
    logfile    = "/var/log/lsyncd/lsyncd.log",
    statusFile = "/var/log/lsyncd/lsyncd-status.log"
}

sync{default.rsync, delete=false, source="/home/joel/script", target="/var/www/html/script", rsync = {chmod = "755", chown = "apache:apache"}}

This does sync the folder script in the destination when I try running it from commandline, but chmod or chown never works. Kindly advice

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.