This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
#set -x | |
# ask user for password | |
read -p "Input password for check: " -t 30 passwd | |
# sha1sum replaced openssl sha1 | awk '{ print $2;}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright Andrey Mitrofanov | |
# Copyright pavlinux http://pavlinux.ru | |
# 2011 | |
MAXCOUNT=20 | |
count=0 | |
network_v6=2a01:7a0:2:12 # your ipv6 network prefix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#The initial creation of ZFS partition for further incremental copying | |
pool=zroot #source distination | |
pool2=tank #recipient pool | |
volume2=$pool2/backup/$pool #recipient | |
fs_list='/mysql /usr /usr/ports /usr/src /usr/home /tmp /var /var/crash /var/db /var/db/pkg | |
/var/empty /var/imap /var/imap-cache /var/log /var/mail /var/run /var/tmp'" | |
"`zfs list | grep ^zroot/www | awk ' {print $5}' | tr "\r\n" " "` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "date +'%F %R:%S'" > /root/VPSbackups/last.timestamp.backup | |
tar czvf /root/VPSbackups/VPSbackup.tar.gz -N"$LAST" --exclude-from=/VPSbackups/tar.excludelist.txt /etc/ /root/exportdb/ /home/username/ > /root/VPSbackups/backup.log 2>&1 | |
##где tar.excludelist.txt - список исключений; | |
##а LAST - файл с датой в формате date +'%F %R:%S' | |
LAST=`cat /root/VPSbackups/last.timestamp.backup` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Random generator ipv6 addresses within your ipv6 network prefix. | |
#!/usr/local/bin/bash | |
# Copyright | |
# Vladislav V. Prodan | |
# universite@ukr.net | |
# 2011 | |
array=( 1 2 3 4 5 6 7 8 9 0 a b c d e f ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Just a small script I wrote to backup mysql via ZFS snapshots | |
#!/bin/sh | |
# Copyright (c) 2011 Vladislav V. Prodan <universite at ukr.net> | |
# My MySQL server uses the directory: | |
# tank/mysql # main directory MySQL | |
# tank/mysql/ibdata # data of InnoDB tables | |
# tank/mysql/iblogs # InnoDB transaction logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# zfs snapshot auto-rotation | |
# | |
# usage: zfs_snapshot.sh <mountpoint> <snapshot name> <number of keeping snapshots> [recursive] | |
# | |
# recursive option: Recursively create snapshot (zfs snapshot -r) | |
# | |
# for crontab | |
# |
NewerOlder