Install GMVault on a Synology NAS - Follow-up

By Jimmy Bonney | November 17, 2012
GMVault

Following the installation of a new version of the firmware on the Synology, I had to re-configure the gmail backup that I previously discussed in this article.

I took this opportunity to do two things:

  1. try out the alternative method that I suggest in order to install python easy_install tool
  2. install GMVault through the Python Package Index method

This article will be less verbose than the previous one and will mainly focus on the commands that are necessary during the installation.

Install Required Tools

  1. Login as root through SSH: ssh root@IP
  2. Install bootstrap following the installation instruction available on Synology forum in order to have ipkg available
  3. Install Python: ìpkg install python27
  4. Install easy_install: ipkg install py27-setuptools
  5. Install nano: ipkg install nano
  6. Create symbolic links as we did in the first article:
    • cd /opt/bin/
    • ln -s /opt/bin/python2.7 python
    • ln -s /opt/bin/pydoc-2.7 pydoc
    • export PYTHONPATH=/opt/local/lib/python2.7/site-packages

Install GMVault

  1. Login as the normal user through SSH: ssh jimmy@IP
  2. Install a virtualenv in /volume1/data/backups/gmail as described in pip installation instruction:
    • cd /volume1/data/backups/gmail
    • curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py -k
    • python virtualenv.py gmvault_env
    • Not necessary: . gmvault_env/bin/activate
  3. Install GMVault as described in their installation page. We’ll use the Python Package Index (PyPI) method.
    • cd gmvault_env/bin/
    • ./pip install gmvault
  4. GmVault is now accessible from /volume1/data/backups/gmail/gmvault_env/bin/gmvault

Configure Backup Script

In the previous article, a script was created in order to run the necessary backup command. It needs to be updated to use the new path under which GMVault is available. Open the backup script file nano /volume1/data/gmail_backup.sh and update it with the following content:

#!/bin/sh
echo "Home: "
echo $HOME
echo "Logname: "
echo $LOGNAME
sh /volume1/data/backups/gmail/gmvault_env/bin/gmvault sync --resume -t quick --db-dir /volume1/data/backups/email email.address@gmail.com

Set and Forget - Cron job

It should not have changed but here are the necessary steps to ensure that backups are run on a regular basis.

  1. Login as root through SSH: ssh root@IP
  2. Open the cron tasks: nano /etc/crontab
  3. Ensure that one of the tasks run the backup script discussed in the previous section: 0 0,12 * * * username su -c "sh /volume1/data/gmail_backup.sh" - username 1>/volume1/@tmp/gmail.log 2>/volume1/@tmp/gmail.err
  4. Stop the cron daemon: /usr/syno/etc/rc.d/S04crond.sh stop
  5. Start the cron daemon: /usr/syno/etc/rc.d/S04crond.sh start

Conclusion

The method used in this article to deploy GMVault is a bit more direct and less painful than in the first article. There is no compilation needed and GMVault can simply be installed by a non-root user. In addition, GMVault now runs in its own Python environment which makes it less sensitive to software upgrade.


Credits Image


comments powered by Disqus