mgsautils.git
8 years agobackup_diff.sh: Replaced "ls --sort=t" with "ls -t" for FreeBSD compatibility
MegaBrutal [Fri, 19 Feb 2016 04:40:30 +0000 (05:40 +0100)]
backup_diff.sh: Replaced "ls --sort=t" with "ls -t" for FreeBSD compatibility

Turns out, "ls --sort=t" is not a valid syntax for FreeBSD, but "ls -t" has
the same function, and is accepted by both GNU and FreeBSD.

modified:   fs/backup_diff.sh

8 years agobackup_diff.sh, backup_full.sh: Updated for new dar versions, added FreeBSD compatibility
MegaBrutal [Mon, 15 Feb 2016 22:10:00 +0000 (23:10 +0100)]
backup_diff.sh, backup_full.sh: Updated for new dar versions, added FreeBSD compatibility

- In dar invocations, changed the "-y9" switch to "-zbzip2:9", as recent
versions of dar don't recognize the former argument. Both arguments mean
the same, though: bzip2 compression on level 9 (best).

- FreeBSD doesn't have the md5sum utility to calculate checksums, thus
FreeBSD's md5 utility is used instead.

modified:   fs/backup_diff.sh
modified:   fs/backup_full.sh

8 years agosnapshot-rootfs.sh, vmhost-status.sh: New path for btrfs binary
MegaBrutal [Thu, 4 Feb 2016 11:23:06 +0000 (12:23 +0100)]
snapshot-rootfs.sh, vmhost-status.sh: New path for btrfs binary

With Ubuntu 15.10, the path of the btrfs binary has changed from /sbin/btrfs to /bin/btrfs.
Therefore, I stopped referring to the binary by full path.
While /bin is in the PATH by default on Ubuntu 15.10 (even for cron jobs),
on older Ubuntus or other distros, you may possibly need to
add /sbin or /bin to the PATH for these scripts.

modified:   fs/snapshot-rootfs.sh
modified:   host/vmhost-status.sh

9 years agobackup_diff.sh, backup_full.sh: Prepared for in-place backups
MegaBrutal [Tue, 29 Sep 2015 03:22:36 +0000 (05:22 +0200)]
backup_diff.sh, backup_full.sh: Prepared for in-place backups

- Added option CLEAN_DIR to backup_fsdiff.conf which enables/disables
purging of the backup directory whenever a new full backup is made.
Previously, the hard-coded behavior was to purge the $STORAGE directory.

- MD5 checksum is now only counted for the recently made backup file.
Previously, all checksums were recalculated.

Now it is possible to have the main backup repository mounted at $STORAGE
and keep several weeks (or whatever backup cycle you have) of backups there.
With previous versions of the script, you were supposed to transfer those
files to a remote server, while the local $STORAGE directory was only used as
temporary storage. Now you can even mount $STORAGE directly from the remote
server through NFS or iSCSI, if that is more convenient for you.

modified:   backup_diff.sh
modified:   backup_fsdiff.conf
modified:   backup_full.sh

9 years agobackup_diff.sh, backup_full.sh: Cleaned up for publication, added rsync transfer...
MegaBrutal [Wed, 2 Sep 2015 20:32:55 +0000 (22:32 +0200)]
backup_diff.sh, backup_full.sh: Cleaned up for publication, added rsync transfer mode

- Moved hard-coded data to separate config file.

- Now it is configurable how to transfer backup files to a remote server:
it is possible by scp or rsync, or to not transfer them at all.
The backup directory may be mounted from a remote server by NFS or other method,
in which case there is no need to transfer the files by scp or rsync.

Note however, backup_full.sh purges the backup directory, because it is assumed
that the files have already been transferred to a remote location.

modified:   fs/backup_diff.sh
new file:   fs/backup_fsdiff.conf
modified:   fs/backup_full.sh

9 years agobackup.sh: Clean up junk if tar creation fails
MegaBrutal [Thu, 20 Aug 2015 05:31:48 +0000 (07:31 +0200)]
backup.sh: Clean up junk if tar creation fails

If the file system gets full during tar creation, and the junk files (SQL dumps, partial TAR) stay there, the file system is left with 100% usage.
This may have very unpleasant consequences, so it's best to simply remove those files.

modified:   mysql/backup.sh

9 years agomysqlbak_check.sh: Truncate file list and show summary
MegaBrutal [Sat, 15 Aug 2015 02:52:28 +0000 (04:52 +0200)]
mysqlbak_check.sh: Truncate file list and show summary

Changed MySQL backup check script to truncate file lists (only show 20 files of the most recent and the oldest backups) and show statistics (file number and summarized
size) at the end of each directory listing.

modified:   mysqlbak_check.sh

9 years ago Initial commit
MegaBrutal [Tue, 4 Aug 2015 02:23:54 +0000 (04:23 +0200)]
 Initial commit

 Changes to be committed:
new file:   fs/backup_check.sh
new file:   fs/backup_check_FreeBSD.sh
new file:   fs/backup_diff.sh
new file:   fs/backup_full.sh
new file:   fs/snapshot-rootfs.sh
new file:   host/check-fs-usage.sh
new file:   host/vmhost-status.sh
new file:   mysql/backup.sh
new file:   mysql/mysqlbak_check.sh
new file:   smf/check_smf_pending_users.sh
new file:   smf/mail_user_profile.sh
new file:   smf/smf_fetch_user_profile.sh