Legacy Archive (2015): Originally written in Chinese on doubixie.com and translated into English for this edition. All archive posts · Home

Backing Up and Auto-Updating Hexo with Dropbox

Original Chinese title: hexo用dropbox备份和自动更新

Installing Hexo

CentOS Dropbox Sync Backup

  • Installing Dropbox on CentOS:

    32位系统
    $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -
    启动dropbox
    $ ~/.dropbox-dist/dropboxd
    • If this is your first time running Dropbox on your server, copy the URL printed in the terminal, open it in a browser, and log in with your Dropbox account to authorize the server. Once authorized, press Ctrl+C to stop the script.
  • Watch out for a possible bug: after the first launch, it sometimes inexplicably stops syncing. In that case, just restart it:

    ps aux|grep dropbox
    kill
    ~/.dropbox-dist/dropboxd
  • Use ln to symlink the Hexo public folder into www, e.g.:

    ln -s /Dropbox/hexo-blog/public /wwwroot/www/web
  • Set permissions on the source directory according to your web server’s user and group. If you want to take a shortcut, just chmod 755 the whole Dropbox folder:

    chmod 755 ~
    
    chmod 755 ~/Dropbox

That’s about it