Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email-Backup #13

Closed
sunnychuchu opened this issue Jun 16, 2021 · 1 comment
Closed

Email-Backup #13

sunnychuchu opened this issue Jun 16, 2021 · 1 comment

Comments

@sunnychuchu
Copy link

sunnychuchu commented Jun 16, 2021

That is great set of scripts, appreciate to all of your works .
The script contains a folder to organize backup file(s) . That is good idea but there are minor issue that is attached file contains the folder name.

image

it is my person modification with daily backup and monthly backup, it will keep monthly and current date backup.

My modification sharing.

#Add type of backup
:local TypeOfBackup "";
:local mday [:pick $YYYYMMDD 6 8];
:if ($mday = "01") do={
set $TypeOfBackup ("Monthly")
} else= {
set $TypeOfBackup ("Daily")
}

#Remove Outdate Backup file
/ file remove [ /file find where name~"^$0/..-$TypeOfBackup-.$"]

#Rewrite File with date & time pattern
:local FileName ([ $CharacterReplace ($Identity . "." . $Domain) "." "_"]."-".$TypeOfBackup."-". $YYYYMMDD . "-". $HHMMSS );

#Rewrite Subject Line with date & time pattern
subject=([ $SymbolForNotification "floppy-disk,incoming-envelope" ] .
"Backup & Config"." ".$TypeOfBackup." ". $YYYYMMDD . " [" . [/system clock get time] . "]"); \

@eworm-de
Copy link
Owner

Well, the rationale with the directory is not to organize backups...
I started to use directories in email-backup and upload-backup to make sure the scripts do not conflict. E-mails are sent from queue now, thus the backup files have to be present after the script exited. Running upload-backup when the mail from email-backup has not been flushed from queue could result in corrupted backups without directories.

However devices with low flash storage and/or RAM (depend on where the file are written to) are not uncommon with Mikrotik. That's why the scripts will clean up the files soon - already prepared in next branch.

Feel free to use the modified script on your devices, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants