Evolution of your git repository

Bildschirmfoto-2015-03-20-um-08.03.44_leadimage.png

gource --path path/to/repo --seconds-per-day 0.15 --title "gogs" -1280x720 --file-idle-time 0 --auto-skip-seconds 0.75 --multi-sampling --stop-at-end --highlight-users --hide filenames,mouse,progress --max-files 0 --background-colour 000000 --disable-bloom --font-size 24 --output-ppm-stream - --output-framerate 30 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -i path/to/music.mp3 -shortest -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 path/to/output.mp4

Backup script in bash for sites

#!/bin/bash

# site_name site_loc back_loc db_name db_user db_pass

NOW=$(date +%Y%m%d-%H%M%S)
LOG=/root/backup.log
FILES=1
DB=1

BACKUP_PSW_FILE=/root/.database


OLD_IFS="$IFS"
IFS=$'\n'

for LINE in `cat $BACKUP_PSW_FILE`; do
    IFS=' '
    ARRAY=($LINE)
    site_name=${ARRAY[0]}
    site_loc=${ARRAY[1]}
    back_loc=${ARRAY[2]}
    db_name=${ARRAY[3]}
    db_user=${ARRAY[4]}
    db_pass=${ARRAY[5]}
#    DB_SQL="${DB_NAME}.${DB_TYPE}.sql"

    echo "$(date)=====================START $site_name backup======================" >> $LOG

# ARCHIVING WEB SITES INTO TAR.GZ

    if tar -zcpf $back_loc/$NOW-$site_name.tar.gz $site_loc; then
        echo "$(date) $NOW-$site_name.tar.gz creation PASS" >> $LOG
        if gunzip -c $back_loc/$NOW-$site_name.tar.gz | tar t > /dev/null; then
       echo "$(date) $NOW-$site_name.tar.gz check PASS" >> $LOG
       FILES=0
        else
       echo "$(date) $NOW-$site_name.tar.gz check FAIL" >> $LOG
       rm $back_loc/$NOW-$site_name.tar.gz
        fi
    else
        echo "$(date) $NOW-$site_name.tar.gz creation FAIL" >> $LOG
    fi

done

IFS="$OLD_IFS"

How to backup databases in mongodb

mongodb.png

# Cron jobs
# Dump all databases
3 3 * * * mongodump --out /var/backups/mongobackups/`date +"%m-%d-%y"`
# Find and remove databases older the 7 days
3 1 * * * find /var/backups/mongobackups/ -mtime +7 -exec rm -rf {} \;
# Restore dump
sudo mongorestore --db newdb --drop /var/backups/mongobackups/01-20-16/newdb/

or by bash script:

date=`date +"%m-%d-%y"`
`mongodump --out /var/backups/mongobackups/$date`

GitHub – denisgolius

Denis

Ukraine

https://www.linkedin.com/in/denis-golius-1088b79b https://www.facebook.com/michaelweiss1234