Skip to content

Instantly share code, notes, and snippets.

View constantinoneto's full-sized avatar

Constantino Augusto Dias Neto constantinoneto

View GitHub Profile
@constantinoneto
constantinoneto / backup.sh
Created February 1, 2012 12:37
Backup Postgres
#! /bin/sh
DATE=`date +%Y%m%d`
log_file="/home/backup/base_`date '+%Y%m%d'`.log"
sources_dir=/home/backup
file_bk=backup-base_`date '+%Y%m%d'`.sql.gz
cd /usr/local/postgresql/bin/
/usr/bin/pg_dumpall -v -U minha-base | gzip > /home/backup/base-suse_`date '+%Y%m%d'`.sql.gz
cd $sources_dir
@constantinoneto
constantinoneto / rails.logrotate
Created February 1, 2012 12:35 — forked from jweslley/rails.logrotate
Logrotate for Rails
#
# File: /etc/logrotate.d/rails
# Test: logrotate -f /etc/logrotate.d/rails
#
/var/www/*/log/*.log {
daily
dateext
notifempty
missingok
rotate 30