Skip to content

Backup to mail, is a bash script to send local backup file to e-mail account as attached file.

License

Notifications You must be signed in to change notification settings

pilasguru/backup2mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

backup2mail

Backup to mail, is a bash script to create local backup file and then send it to an e-mail account as attached file.

Installation

  • Requires a full functional MTA (smtp) working at localhost

  • It is suggested mail comand (if not, errors goes to STDERR)

apt-get install bsd-mailx
  • Requires biabam utility:
apt-get install biabam
  • Install backup2mail (you may use git)
cd /usr/local/sbin
wget https://github.com/ysidorito/backup2mail/archive/master.zip
unzip master.zip && rm master.zip
cd backup2mail-master
chmod 750 backup2mail.sh
  • Edit backup2mail.sh and configure first VARIABLES to your environment.
  • Create respaldar.txt file wih a file/folder at each line
/etc
/usr/local
/var/www/index.php
  • Include into cron.daily task:
ln -s /usr/local/sbin/backup2mail/backup2mail.sh /etc/cron.daily/backup2mail

Ready!

ToDo

  • Avoid local disk usage previous create tgz
  • Incluir contenido del respaldo en el texto del e-mail
  • Avoid error if $FILELIST do not exists (enables isolated run)
  • Error to STDERR if mail command or smtp-local-server not installed
  • Define max size to e-mail (perhaps split attached file)
  • Ensure work on RedHat family OS too

About

Backup to mail, is a bash script to send local backup file to e-mail account as attached file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages