https://github.com/burnsoftnet/archivemysqlbackups-perl
The ArchiveMySQLBackups-Perl ( bsaf.pl ) was created to help automate the automatic archiving of MySQL Backups on a Linux Machine. It will copy the *.sql files to a sub folder that is named after the current year and month, then after it copies all the files over, it will compress that directory into 1 tar file. It was designed to run daily before the end of the day so if the year_month.tar.gz exists, then it will append to that file.
https://github.com/burnsoftnet/archivemysqlbackups-perl
archive-dot-org linux-machine mysql mysql-backup nix perl
Last synced: 2 months ago
JSON representation
The ArchiveMySQLBackups-Perl ( bsaf.pl ) was created to help automate the automatic archiving of MySQL Backups on a Linux Machine. It will copy the *.sql files to a sub folder that is named after the current year and month, then after it copies all the files over, it will compress that directory into 1 tar file. It was designed to run daily before the end of the day so if the year_month.tar.gz exists, then it will append to that file.
- Host: GitHub
- URL: https://github.com/burnsoftnet/archivemysqlbackups-perl
- Owner: burnsoftnet
- License: mit
- Created: 2016-12-16T13:05:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-27T13:48:27.000Z (over 7 years ago)
- Last Synced: 2025-07-29T03:49:24.835Z (11 months ago)
- Topics: archive-dot-org, linux-machine, mysql, mysql-backup, nix, perl
- Language: Perl
- Homepage:
- Size: 342 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ArchiveMySQLBackups-Perl
The ArchiveMySQLBackups-Perl ( bsaf.pl ) was created to help automate the automatic archiving of MySQL Backups on a Linux Machine. It will copy the *.sql files to a sub folder that is named after the current year and month, then after it copies all the files over, it will compress that directory into 1 tar file.
It was designed to run daily before the end of the day so if the year_month.tar.gz exists, then it will append to that file.
## Usage
All the settings that you need for this script will be stored at the first part of the script.
| Code | Description |
|:--|:--|
| my $VERSION = '1.0.01'; | Version of Script |
| my $foldername =""; | place holder |
| my $destdir ="/shares/backups/MySQL/archived"; | Destination Directory |
| my $sourcedir ="/shares/backups/MySQL/*.sql"; | Source Directory with File Extension |
| my $DEBUG =0; | Debug Mode (Display Messages) |
| my $MOVEONLY =1; | Enable Move Files |
| my $DOZIP =1; | Enable Zip compression on folder |
| my $DOCLEANUP =1; | Delete the year_month folder after compressing |
| my $DestDirFinal=""; | place holder |
| my $ZipDest =""; | place holder |
Set the *$destdir* to the directory that you want to store the archive files. Then use the *$sourcedir* to set the location of the backup files.
the *$DEBUG* is optional if you want messages outputted to the screen.
If you are testing, then toggling the ability to move the files, zip them and then clean up the old files might interest you.
If so then use the $DOZIP, *$DOCLEANUP* and *$MOVEONLY* switches accordingly.
After you have everything set the way you want it, then run the script. If it is to your liking, then add it in a cron job.