File: backup.sh

package info (click to toggle)
opendb 0.81p18-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,716 kB
  • ctags: 6,787
  • sloc: php: 50,213; sql: 3,098; sh: 272; makefile: 54; xml: 48
file content (18 lines) | stat: -rw-r--r-- 610 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

#
filename="opendb-backup-`date +%d%m%y`.sql"

lynx -accept_all_cookies -dump -dont_wrap_pre 'http://opendb.i-am-vegan.net/demo/login.php?op=login&uid=<opendb_admin_uid>&passwd=<opendb_admin_password>&redirect=backup.php%3Fop%3Dexport%26all_tables%3Dy%26send_as_format%3Dfile' > /tmp/$filename

# Compress sql
gzip -c /tmp/$filename > /tmp/${filename}.gz
rm /tmp/$filename

# Encode and Send email
uuencode /tmp/${filename}.gz ${filename}.gz > /tmp/${filename}.gz.enc
rm /tmp/${filename}.gz

mail -s "OpenDb Backup" jasonpell@i-am-vegan.net < /tmp/${filename}.gz.enc  
rm /tmp/${filename}.gz.enc