3 Set up a back up user on the Moodle server

Backing up files require some privileges, but it is not safe to remotely log in as root. As a result, it is best to set up a new account (moo) on the Moodle server just for back up purpsoes. Then, we can use sudo to permit specific privilege elevation:

moo ALL = (root) NOPASSWD: /usr/bin/unison, \  
          (postgres) NOPASSWD: /usr/bin/pg_dumpall, \  
  (postgres) NOPASSWD: /bin/gzip