Skip to content

Instantly share code, notes, and snippets.

View mewben's full-sized avatar

Melvin Soldia mewben

View GitHub Profile
@mewben
mewben / gist:2febd72fc82278a447b7
Created September 26, 2015 14:16 — forked from audy/gist:52215fc35ac163006f42
dokku postgresql rsync nightly backup

dokku postgresql rsync nightly backup

This is a rough guide to automating a nightly 7-day rolling remote backup of your PostgreSQL database(s) for your dokku app(s). There is a slight difference if you are using an older version of Dokku.

This will save the comprssed output of pg_dump as well as the contents of the /home directory on your dokku machine (just in case).

You will need to create a shell script in /root and edit the cron file.

-- Schema: public
DROP SCHEMA public CASCADE;
DROP SCHEMA retail CASCADE;
DROP SCHEMA logs CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
COMMENT ON SCHEMA public
// example.js
// ===============================
//
// Client-side (browser) example of how you might connect a socket.io client
// to your Sails backend.
// For the latest docs on talking to Sails via socket.io, check out the new reference section in the Sails docs:
// https://github.com/balderdashy/sails-docs/blob/master/reference/SocketClient.md
// As for some great tutorials, my best recommendation would be to check out @irlnathan's sailscasts:
module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};