If I wanted to zip up (or tar.gz up) a list of paths (recursively) on a Linux VPS, then email the ZIP/TAR to myself, then delete the ZIP/TAR, what's the easiest way to do this? A shell script on a cron job, a program, etc.?
For example, here's what I'd likely do:
Stop apache, mysql, postgresql, and rack
Zip up:
/etc/httpd/conf/httpd.conf /etc/httpd/conf.d/* /home/kerrick/* /var/lib/mysql/* # etc.
Email the zip file as an attachment to
[email protected]
Delete the zip file
Resume apache, mysql, postgresql, and rack
/var/lib/mysql/
is quite likely to exceed the maximum size for an attachment, even when zipped. You might want to considerscp
instead.mysqldump
instead of stopping mysql and copying the datafiles? The dump will compress well and not include indexes and log data.