forked from justalinko/dbackres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompress.sh
17 lines (15 loc) · 909 Bytes
/
compress.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
source /etc/db_backres/db_alinko.conf
cek_jml=`ls /var/db_backres/backup | wc -l`
if [[ $cek_jml -gt 10 ]]; then
zip -r /var/db_backres/backup/bak_$formatgl.zip /var/db_backres/backup > /dev/null 2>&1
rm /var/db_backres/backup/db-backup-alinko*.sql
echo "========================================================" >> /var/log/db_backup.log
echo "FILES BACKUP COUNT AT [ "$formatgl" ] :: "$cek_jml" :: " >> /var/log/db_backup.log
echo "COMPRESSED /var/db_backres/backup/bak_"$formatgl".zip" >> /var/log/db_backup.log
echo "========================================================" >> /var/log/db_backup.log
else
echo "========================================================" >> /var/log/db_backup.log
echo "FILES BACKUP COUNT AT [ "$formatgl" ] :: "$cek_jml" :: " >> /var/log/db_backup.log
echo "========================================================" >> /var/log/db_backup.log
fi