top4ek
06.03.2012 13:15 Psi+F678AFC6
ЦЭ быдлоскриптинг :)
#!/bin/bash
DATE=( $(date +"%Y %m %d") )
DIRDATE=${DATE[0]}-${DATE[1]}-${DATE[2]}
TMPDIR=/tmp/backup
mkdir ${TMPDIR}
mount -t nfs -o ro 10.0.5.3:/home/DataBase /mnt/DataBase
7z a -mx=9 -pBolshoyISlozhniyParol "${TMPDIR}/${DIRDATE}.7z" /mnt/DataBase/db-sklad
chown dropbox:dropbox "${TMPDIR}/${DIRDATE}.7z"
cmod 777 "${TMPDIR}/${DIRDATE}.7z"
find /mnt/Dropbox/Dropbox -name "*.7z" -type f -Btime +15d -delete
mv "${TMPDIR}/${DIRDATE}.7z" /mnt/Dropbox/Dropbox/
umount /mnt/DataBase
rmdir ${TMPDIR}