Score:0

Sync a local file with server to be served

fr flag

I have a little website which serves a pdf file using nginx. I change the file once a week and I need it to sync with the file that's on the server. My approach was using scp (ssh), however, I can only upload the file into admin's home directory, while it requires to be put into /var/www. Is there any practical and safe way of doing it? I thought about setting up a cron job that'd just copy it from home to /var/www, but I'm concerned whether it's safe to do so or whether it's considered to be a "bad practice". What would be your suggestion?

vidarlo avatar
ar flag
*Why* can't you scp straight to `/var/www/`?
djdomi avatar
za flag
root can copy anywhere, so why you cant do it?
fr flag
I can't access root with SSH, it's possible only with sudo, but afaik, scp can't use sudo command.
vidarlo avatar
ar flag
Change permissions or add user to an appropriate group?
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.