hMailServer Offsite Backup

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

hMailServer Offsite Backup

Post by palinka » 2020-10-27 17:51

First of all, I have to give Jimimaseye 100% credit for this. Except for the uploading part, its all from his backup script here: https://hmailserver.com/forum/viewtopic ... 21&t=28139 which I've been using with great success for over a year. I wasn't planning on touching it at all, but I couldn't figure out how to modify the original to do what I wanted. So I re-wrote the whole thing in powershell, which I know a lot better than plain old windows command line. :oops: You know what they say - its easier to write code than to read code. :lol:

Anyway, it does exactly the same thing, except for two things - it compresses the backup files to a password protected archive and it uploads the archive to LetsUpload.io.

I recently discovered letsupload when I was looking for a solution to back up work files offsite. Its free and unlimited and has an API. The only caveat is that undownloaded files are deleted after 60 days. For backup purposes, that's no big deal. 60 days is plenty as far as I'm concerned.

The only requirement is installing 7-zip and putting it in the system path. Also, the database must be mysql -or- internal db (same as the original script).

One note about 7-zip: It takes A LOT longer to compress with encryption than unencrypted. However, I believe this is a necessary action because I wouldn't feel comfortable throwing up my personal files into a barely known storage space. My last run took 34 minutes 45 seconds to create a 2,549 MB encrypted archive from 5,117 MB backup data dir (as reported by 7-zip). My hardware is not exactly cutting edge, so you can probably do better than that.

The sequence of events goes like this:

1. Stops hMailServer and (if in use) Spamassassin Services
2. Updates Spamassassin (if in use)
3. Cycles hMailServer and (if in use) Spamassassin logs
4. Backs up hMailServer data directory using RoboCopy
5. Dumps MySQL database -or- internal database and adds to backup directory
6. Restarts Spamassassin (if in use) and hMailServer
7. Deletes messages older than specified number of days in specified folders (eg Trash, Spam, etc)
8. Compresses the backup directory into a multi-volume 7z archive with AES-256 encryption (including header encyrption)
9. Creates a folder at LetsUpload.io and uploads the archive files
10. Sends success/fail email with debug log attached

You can see the sequence of events is exactly the same as the original script except for the type of zip archive and uploading to letsupload. I split the archive into 100MB volumes and each takes < 20 seconds to upload. The last run was 26 volumes and took 8.5 minutes in total.

Although the original backup script is fantastic, one thing I tried to improve on was the email and log output. The things I looked for in the log every morning was the number of spam & viruses, and robocopy stats for how many messages were added (received since the last backup) and deleted, so I included that information in the email body. Also, I included a bunch of timers so you can see how long each operation takes. I think that's useful information.

I also "improved" the cleardown script so that it only reports messages deleted and the total count - also included in the email body. "Improved" in quotation marks because this part is yet to be heavily tested and my skills in this area can't match Jimi's, although if you want to just try it out, its a function in a separate file, so just comment out the DeleteByDBID lines and give it a go. Its working for me without errors so far.

Files here: https://github.com/palinkas-jo-reggelt/ ... ite_Backup

Enjoy. :D

User avatar
jimimaseye
Moderator
Moderator
Posts: 10060
Joined: 2011-09-08 17:48

Re: hMailServer Offsite Backup

Post by jimimaseye » 2020-10-27 18:11

palinka wrote:
2020-10-27 17:51
First of all, I have to give Jimimaseye 100% credit for this. Except for the uploading part, its all from his backup script here: https://hmailserver.com/forum/viewtopic ... 21&t=28139
Arrr..... ....memories. 🥰
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-10-27 19:35

Probably the most useful script in the whole place. 👍

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-10-30 15:20

I added better error handling for the upload part.

* If there is a failure during upload, it will try again N times (specified in the config).
* If there's a successful upload, but the remote file size does not match the size of the file uploaded, it will throw an error, delete the uploaded file and try again.
* At completion, it counts the remote files and compares to the local backup files. If there's a mismatch, it NOTIFIES of an error, but doesn't try the whole upload process over again.

I've been running it for the past week and tweaking the debug output as I go along.

Here's a sample email notification. I don't know why, but it took about twice as long last night as previous nights. Part of that is due to slower upload speeds than normal, which have been <20 seconds per 100mb volume.

Code: Select all

:::   hMailServer Backup Routine Thursday, October 29, 2020   :::
 
HMS Server Start Time: 2020-10-28 23:58:59
HMS Daily Spam Reject count: 0
HMS Daily Viruses Removed count: 0
 
* hMailServer successfully stopped
* SpamAssassin successfully stopped
* SpamAssassin successfully updated
* hMailServer DataDir successfully backed up
[INFO] RoboCopy Stats: 35 new, 229 deleted, 0 mismatched, 0 failed
* SpamAssassin successfully started
* hMailServer successfully started
* Deleted 13 messages in specified folders older than 30 days successfully
* 7-Zip archive of backup files creation successful
* Offsite upload of backup archive completed successfully: 26 files uploaded to https://letsupload.io/folder/<redacted>/2020-10-29-hMailServer
 
hMailServer Backup & Upload routine completed in 2 hours 11 minutes 6 seconds
Here's a sample log file. Gets attached to the email.

Code: Select all

::: hMailServer Backup Routine Thursday, October 29, 2020 :::
 
10/29/2020 11:58:04 PM : HMS Server Start Time           : 2020-10-28 23:58:59
10/29/2020 11:58:04 PM : HMS Daily Spam Reject count     : 0
10/29/2020 11:58:04 PM : HMS Daily Viruses Removed count : 0
10/29/2020 11:58:04 PM : ----------------------------
10/29/2020 11:58:04 PM : Stop hMailServer
10/29/2020 11:58:05 PM : hMailServer running. Preparing to stop service.
10/29/2020 11:58:05 PM : hMailServer shutting down.
10/29/2020 11:58:07 PM : hMailServer successfully stopped
10/29/2020 11:58:08 PM : ----------------------------
10/29/2020 11:58:08 PM : Stop SpamAssassin
10/29/2020 11:58:08 PM : SpamAssassin running. Preparing to stop service.
10/29/2020 11:58:08 PM : SpamAssassin shutting down.
10/29/2020 11:58:13 PM : SpamAssassin successfully stopped
10/29/2020 11:58:13 PM : ----------------------------
10/29/2020 11:58:13 PM : Updating SpamAssassin
10/29/2020 11:58:55 PM : Update available for channel updates.spamassassin.org: 1882909 -> 1882965
http: (curl.exe) GET http://spamassassin.apache.org/updates/MIRRORED.BY, success
http: (curl.exe) GET http://www.sa-update.pccc.com/1882965.tar.gz, success
http: (curl.exe) GET http://www.sa-update.pccc.com/1882965.tar.gz.sha1, success
Update available for channel spamassassin.heinlein-support.de: 1944 -> 1946
http: (curl.exe) GET http://www.spamassassin.heinlein-support.de/MIRRORED.BY, success
http: (curl.exe) GET http://www.spamassassin.heinlein-support.de/1946.tar.gz, success
http: (curl.exe) GET http://www.spamassassin.heinlein-support.de/1946.tar.gz.sha1, success
Update was available, and was downloaded and installed successfully

10/29/2020 11:58:55 PM : Finished updating SpamAssassin in 41 seconds
10/29/2020 11:58:55 PM : ----------------------------
10/29/2020 11:58:55 PM : Cycling Logs
10/29/2020 11:58:55 PM : Cylcled hmailserver_events_2020-10-29.log
10/29/2020 11:58:55 PM : Cylcled spamd_2020-10-29.log
10/29/2020 11:58:55 PM : ----------------------------
10/29/2020 11:58:55 PM : Start backing up datadir with RoboCopy
10/29/2020 11:59:01 PM : 
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Thursday, October 29, 2020 11:58:55 PM
   Source : C:\HMS-DATA\
     Dest : C:\HMS-BACKUP-TEMP\hMailData\

    Files : *.*
	    
  Options : *.* /NDL /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /R:43200 /W:1 

------------------------------------------------------------------------------

	  *EXTRA File 		 783.2 m	C:\HMS-BACKUP-TEMP\hMailData\MYSQLDump_2020-10-28.mysql
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\00\{00D3DE0D-41BF-4EB8-B56B-E69B15D53CBD}.eml
	  *EXTRA File 		    1120	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\01\{0187DA47-A75A-4B93-BD9F-3DB3C2DD6832}.eml
	  *EXTRA File 		   20529	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\02\{021CE8AE-F0EA-4C95-81EC-46DAD520CC4A}.eml
	  *EXTRA File 		    1334	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\03\{0316D406-CB30-46FD-9F50-16FAC4193AF9}.eml
	  *EXTRA File 		    1315	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\03\{036283AC-D5E1-4C76-81AC-538F3515F082}.eml
	  *EXTRA File 		    1357	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\03\{03B1A6AD-0BE6-46AE-B443-737214CD01C9}.eml
	  *EXTRA File 		    1353	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\04\{040E4C3E-242C-415A-9917-D0E7F1F3115D}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\06\{060833D3-66AE-458A-B5E2-33B1F3C15950}.eml
	  *EXTRA File 		    1317	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\08\{08E41F4C-10F3-4B3F-AE0D-614B6EB3954D}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\09\{09EDDBDC-F21E-496C-8AC7-E3D085BE2FC8}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\0C\{0C55C25B-CAAD-4DCA-9473-9787F3F16870}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\0C\{0C722547-75F7-4115-A85C-DA5CD0E55990}.eml
	  *EXTRA File 		    2674	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\0D\{0D0E0F30-CCE0-41CA-A7A7-DF93EA08F760}.eml
	  *EXTRA File 		    6912	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\0E\{0E614C04-8F3E-40E7-8332-69D49D459230}.eml
	  *EXTRA File 		    1104	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\0F\{0F458BAA-B0B9-4EA5-B328-D1603C4A4E2F}.eml
	  *EXTRA File 		    1104	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\10\{100EEF35-47E8-4FF7-AAA2-8056EFF79DB9}.eml
	  *EXTRA File 		     679	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\13\{13CDCBF7-BA32-4D12-B3E2-0EB748579E90}.eml
	  *EXTRA File 		    1311	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\13\{13D995B2-3134-4578-B947-07DE7340E36B}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\14\{1459DA0A-4CBE-4D53-B389-77D5CA6562E1}.eml
	  *EXTRA File 		    1310	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\15\{157D66BC-5DBB-48D4-A732-D617EEDECC9D}.eml
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\15\{159D52D0-5168-453E-BABC-5CEDDA22F86C}.eml
	  *EXTRA File 		    5389	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\16\{1670E689-1C2E-4089-B9EF-BE883C7D609B}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\16\{16B8D590-D29D-4CD4-B628-DDD6CD48C0A5}.eml
	  *EXTRA File 		     550	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\17\{17238172-FD5F-413A-8945-0B2550B42D52}.eml
	  *EXTRA File 		    2487	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\17\{179DEFAB-CF7C-4FCD-B61C-83A69B92E5A3}.eml
	  *EXTRA File 		    1119	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\19\{1972120C-2863-41FE-8700-2A54CACCCC7A}.eml
	  *EXTRA File 		     654	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1A\{1AFC1BA8-9664-4518-83E2-316544D7FF61}.eml
	  *EXTRA File 		    1311	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1B\{1B021533-01CC-4F6F-9F53-8970F67CA8F5}.eml
	  *EXTRA File 		    1288	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1B\{1B1CBA45-EEAE-4145-8EAE-EB7D8FB14867}.eml
	  *EXTRA File 		     636	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1C\{1C7D72BE-500F-4238-905D-7A4D5126BDC3}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1C\{1CC5C380-A131-491E-8678-174218FD84ED}.eml
	  *EXTRA File 		     610	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1C\{1CCC7D2B-BD77-4D4B-808E-02134B80964E}.eml
	  *EXTRA File 		     603	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\1D\{1D66FF3F-1DED-430D-B6A0-ACF60E634C85}.eml
	  *EXTRA File 		     638	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\20\{20E3E8CA-7EF3-4C35-A26E-377218DB2E0F}.eml
	  *EXTRA File 		    1282	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\22\{226B7C02-FB2B-4018-A6FD-7B8FD75B2A8A}.eml
	  *EXTRA File 		     724	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\23\{23C3ED43-F54E-40EF-9EA7-6B96907D2DE4}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\27\{271B526B-38ED-422D-A670-E8D17961874C}.eml
	  *EXTRA File 		    1359	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\27\{2755CA5D-8F15-498C-B496-2FC88150E864}.eml
	  *EXTRA File 		     636	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\28\{28FDDDCE-6831-44F3-A9F7-A9EDC8C0722D}.eml
	    New File  		     906	C:\HMS-DATA\Data\mydomain.tld\admin\29\{29BD860E-C69D-4806-8DEF-725D9843D0EB}.eml
	  *EXTRA File 		    1310	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2B\{2B13FF1C-44D0-4EC5-998B-FEF3773372C2}.eml
	  *EXTRA File 		     995	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2B\{2BFE41B8-338E-41BD-BF6F-36007FB32FF8}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2C\{2C95DE02-9163-457C-A99A-5CC98A4B5EF4}.eml
	  *EXTRA File 		     836	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2C\{2CBC0F4E-CE97-4037-8A1B-7DCCF4CA6CE8}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2D\{2D01080A-BEFD-4144-8F58-B61697336253}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2D\{2D8E6D01-AA9D-4DF4-8755-FC63BAB73351}.eml
	  *EXTRA File 		    1119	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2E\{2E8F76C6-70EC-46B6-8760-55245BFC71B0}.eml
	  *EXTRA File 		   41201	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\2E\{2E991751-4664-42CB-A27F-A3C173A07FBD}.eml
	    New File  		   50706	C:\HMS-DATA\Data\mydomain.tld\admin\2F\{2FC7B744-94CF-43A7-9A75-7496780743D8}.eml
	  *EXTRA File 		     699	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\31\{314FEE11-87F5-4B75-91C8-EB08D063B992}.eml
	  *EXTRA File 		     713	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\31\{318953DD-8640-4848-8BF5-F99FC2FD5474}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\35\{3582BA56-E90F-41FC-BF65-6B7314518110}.eml
	  *EXTRA File 		     570	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\36\{3670BD15-547C-480C-BDAF-A284525C232A}.eml
	  *EXTRA File 		    1283	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\37\{37F119BF-8048-4CCB-B36E-ACB5D324916C}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\3A\{3A9833E1-B0D3-411E-A7C0-C063897139F5}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\3B\{3B9B9C55-69AF-4225-A599-8DF34900F503}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\3B\{3BA6B93D-8340-4505-9EBF-8A53EA09BF8C}.eml
	  *EXTRA File 		     550	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\3D\{3DF48C72-D140-4338-B61B-E6D14C9FC430}.eml
	  *EXTRA File 		   17090	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\3F\{3F93D7C2-7FA2-4D4C-8D93-3B59A70F778E}.eml
	  *EXTRA File 		     550	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\42\{42FDD15E-D390-4356-A98C-7A6BB592BB47}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\45\{45C1E815-C2B3-4261-9A4C-88BF3AC7DC71}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\46\{4672F034-D43B-4E89-B830-9B034E89AF3C}.eml
	  *EXTRA File 		     550	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\48\{4859AA41-6E3B-4227-81DC-9FACA69B4AC2}.eml
	  *EXTRA File 		   17137	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4A\{4A0465E5-5243-4E66-8406-3D73B250FFE1}.eml
	  *EXTRA File 		    1282	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4A\{4A80D6AA-4B3B-412F-8D3C-A311EE4002BF}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4A\{4AD1DB5E-5B94-489D-80D4-F0FDB2298134}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4B\{4BEE8236-60B1-4E3F-AF63-9DD75DBADE56}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4D\{4D646845-20D1-4A7A-899F-7D04F8449678}.eml
	  *EXTRA File 		     907	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4D\{4D7F934F-59F7-4556-8FDE-D86CD32CC19B}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\4F\{4F6A8C18-E2D3-4FA2-A9E8-B5654F3FB30A}.eml
	  *EXTRA File 		   18080	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\50\{50C0054A-117E-47B8-B9BC-61133FAD09AE}.eml
	  *EXTRA File 		    1311	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\51\{5129D041-CC6F-4868-B3AD-77F60531DBA6}.eml
	  *EXTRA File 		    1360	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\53\{531CE5E6-08B1-417D-8FDA-B10DB0C22B6E}.eml
	  *EXTRA File 		    1357	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\53\{53CFB4F3-9683-4282-98E8-B6FB7B8BEDA5}.eml
	  *EXTRA File 		   45694	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\53\{53D825DC-E9C8-4A81-9E32-A777093EA405}.eml
	  *EXTRA File 		    1519	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\56\{567EB34E-51B3-453D-9051-036FBEA9AF44}.eml
	  *EXTRA File 		    1097	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\57\{577934B1-DB27-4DF9-87B9-62A25BEE169B}.eml
	  *EXTRA File 		    1284	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\58\{58899CC3-5BBA-4BC7-9D60-8CCC27F68993}.eml
	  *EXTRA File 		    2500	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\59\{59EB9722-F1B3-400B-B6FC-BBACC7D6CE78}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\5A\{5A8121C6-C350-4B8F-BC26-25B805ACAF70}.eml
	  *EXTRA File 		     661	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\5B\{5B917990-1B5D-4DA9-8F59-D712E412B3D5}.eml
	  *EXTRA File 		   17138	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\5C\{5C770A89-6852-4DAB-A50C-0C967092CD61}.eml
	  *EXTRA File 		    1313	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\61\{610C0928-6516-465E-BE1E-987FE6664217}.eml
	  *EXTRA File 		    1104	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\62\{6206BF67-25A0-41ED-BD6D-2589EAF79B7F}.eml
	  *EXTRA File 		    1315	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\63\{63E23AE1-F89D-43B5-885B-844E624164CD}.eml
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\64\{640CE006-9FF6-4316-B1C9-578713287EEE}.eml
	  *EXTRA File 		    1357	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\66\{66207C5E-A222-4046-A680-E0CCD41165CE}.eml
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\66\{667C3F8A-9981-4CA8-BB7E-97B90F82D313}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\67\{67124617-F97E-4900-ADD9-AB06638B7BAB}.eml
	  *EXTRA File 		     594	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\68\{6844FA79-9463-4B51-9271-8D28235FBDAD}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\68\{68B51ED4-ABD3-4381-A9C3-1F23532BA3E5}.eml
	  *EXTRA File 		   17138	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\69\{696F94C1-5403-4565-8B10-95D346E2FBDF}.eml
	  *EXTRA File 		    1104	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\69\{69F05C5F-7EEB-4046-B1DC-8170C2C92D6D}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\6E\{6E650FF5-2273-41DD-9FBA-1159EE036190}.eml
	  *EXTRA File 		   17091	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\6F\{6F8B962F-0359-4BC2-AB0A-83AF05CB6F36}.eml
	  *EXTRA File 		    1284	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\71\{71335A4E-C81B-4106-8EFF-20FAD9E08591}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\73\{73CD9B92-DFDE-4258-9974-E121781AEA1B}.eml
	  *EXTRA File 		    1097	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\74\{7431AE80-3E09-46E5-A9C5-96DE2E3256D5}.eml
	  *EXTRA File 		    1358	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\75\{75378727-84C3-4917-8E78-B8741FC25CC4}.eml
	  *EXTRA File 		    1317	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\75\{75D5CA3D-3167-4AD5-9467-D51AA25261B7}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\76\{76C89DF6-25C2-4401-B211-8B986156E062}.eml
	  *EXTRA File 		     661	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\78\{788124C3-D4DC-4239-97E5-FD129DC2E4D1}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\79\{7966132A-00D8-4874-8E15-1FA6AED98693}.eml
	  *EXTRA File 		    2767	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\79\{797776CA-940A-4D0B-8B4E-D460B260EB95}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\7A\{7A067DC8-85F6-4417-9693-DD8F839BAA7A}.eml
	  *EXTRA File 		    1098	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\7B\{7B11E8AD-AC08-428B-AA71-E0D05C31F65C}.eml
	  *EXTRA File 		    1310	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\7C\{7C2DAE00-717B-45A1-934A-6157FAFB53CC}.eml
	  *EXTRA File 		    2514	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\7D\{7D4ED4D4-DE54-4AC1-8F81-01E626A30F6E}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\7F\{7F3DB580-2C56-4D86-B28C-914867381126}.eml
	  *EXTRA File 		    1358	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\82\{82CF03AB-B081-469B-9C9B-D06CB3907B8F}.eml
	  *EXTRA File 		    2514	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\84\{848A98DF-3F02-438B-9CE4-8006C98B1D3C}.eml
	  *EXTRA File 		    1360	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\84\{84D005BD-10D7-4089-83C7-E7ABEEF842B8}.eml
	  *EXTRA File 		    1357	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\85\{85229160-5D6D-4B6F-AAE7-68310E391F06}.eml
	  *EXTRA File 		   17135	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\85\{85904EFF-7DB4-4FA0-8808-E16AF6FF7AB7}.eml
	  *EXTRA File 		    1359	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\85\{85A50354-F055-4B8B-B072-684C89A7B464}.eml
	  *EXTRA File 		    1275	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\85\{85C6DED7-0368-4548-B44E-F39BD98AB06F}.eml
	  *EXTRA File 		     550	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\86\{86B05DDA-13F4-4359-8331-C1FDD8FB737A}.eml
	  *EXTRA File 		     674	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\87\{872CE58A-C5BE-4C38-AB55-22AB721A56DC}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\87\{879AEEFE-7E09-4882-AB27-033B421B82ED}.eml
	  *EXTRA File 		    1339	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\88\{8841EC09-736E-4CA3-B1C4-4C93796ABBFD}.eml
	  *EXTRA File 		     617	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\88\{886F6FD1-795C-486E-A6B8-9DA6B56877AB}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8A\{8A4656D4-6222-42B0-8B9A-A4D0EE939003}.eml
	  *EXTRA File 		    1356	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8A\{8ADCBDD5-D636-4AEC-8D9E-54A5856C649E}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8A\{8AF4B415-8DE4-4585-ABEB-C54C3EB0CD62}.eml
	  *EXTRA File 		    1334	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8B\{8B0F95E0-4E7A-4BFA-864D-8B23779C8DC5}.eml
	  *EXTRA File 		    1284	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8B\{8B19B455-31CE-444E-83E2-AB2BD519E5F5}.eml
	  *EXTRA File 		    2622	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8B\{8B3A43E1-15DF-4BEA-B9C5-152724DC638B}.eml
	  *EXTRA File 		     638	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8B\{8B4E2852-56D5-4230-B9D6-9D3361B8FD9A}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8B\{8BE61A22-31E2-4DB0-8644-60B7852DC6EF}.eml
	  *EXTRA File 		     697	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8C\{8CC92A69-E233-4550-B557-934BEB440CDE}.eml
	  *EXTRA File 		    1313	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8C\{8CED670B-D99B-4850-BCEE-9DCBFD1F48FA}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\8D\{8DFC1715-9EA0-4FB9-BD99-E9ECAFFC1D67}.eml
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\90\{90724CB9-FC5D-45BF-9551-93140AAA09EE}.eml
	  *EXTRA File 		     658	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\90\{90C4241F-12C9-436F-927A-F28AB6AF0FCA}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\92\{92924AFC-DD9D-40B2-B22B-69B9642F7B56}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\94\{94638609-0319-486B-8FB1-0C5119E6C3BA}.eml
	  *EXTRA File 		    1359	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\96\{960A33C1-C1ED-4563-8B73-7CEA296071FD}.eml
	  *EXTRA File 		    1279	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\98\{9864BD3D-CE5B-4D54-940A-828E584CEA54}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\98\{98B3CE73-0A22-4EC6-A188-0A1FB585A41B}.eml
	  *EXTRA File 		    1360	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9A\{9A65E8BA-73B6-4E93-9C56-F22EFE8DC0ED}.eml
	  *EXTRA File 		   17092	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9A\{9A8DF700-1C97-4501-833B-7057C551CFF3}.eml
	  *EXTRA File 		    1105	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9A\{9AABA00B-5E16-4442-AFE5-55CBDC885092}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9B\{9B6C29B9-1859-4999-BC17-865F179E6CE8}.eml
	  *EXTRA File 		    2621	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9B\{9BEBA88D-B81A-4EF8-9D1A-1A5BDE245353}.eml
	  *EXTRA File 		    1978	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9E\{9E54850A-801D-4B3F-BACF-700472B6BBE2}.eml
	  *EXTRA File 		     711	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9E\{9EDE6342-9C3F-4967-BD13-73670C68AE3E}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9F\{9F16A9BC-BCFE-4EFE-9C3A-D4C9403AB33D}.eml
	  *EXTRA File 		    2659	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9F\{9F2E2253-AFC6-43E6-89CD-531E682D33D5}.eml
	  *EXTRA File 		   19417	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9F\{9F7C960B-08DE-4499-B88F-5E5FFE399F29}.eml
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\9F\{9FF4C274-8009-430C-81DD-C3605CB8CE93}.eml
	  *EXTRA File 		     550	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\A2\{A204D6F1-C7EF-4F33-8373-515A0D1490F9}.eml
	  *EXTRA File 		    2820	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\A2\{A2524E89-2372-4F22-A724-CF59CCDCDAF5}.eml
	  *EXTRA File 		   17091	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\A3\{A34D8C90-2C96-4BAA-A6FA-047316CCDB1F}.eml
	  *EXTRA File 		    1310	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\A5\{A526CDEF-40EA-4398-A119-221BCBAC36F5}.eml
	  *EXTRA File 		     594	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\A8\{A8ABF781-A6BA-48EE-93C7-BADD49194CD2}.eml
	  *EXTRA File 		    1096	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\AE\{AE263636-4860-4048-AB56-067C701A2AA9}.eml
	  *EXTRA File 		    1380	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\AF\{AF97EB8D-744A-417C-997F-5337204BE058}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B0\{B019A1F9-5D9D-4758-BC3D-20B3E5193102}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B0\{B0E53AED-8B3B-4557-9256-B91D63F98EAC}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B1\{B192932A-ECBE-4CFA-8FFB-0F92CFE05FDF}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B2\{B2BBACDE-E08F-4F90-A026-F23A48297AFB}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B3\{B3C6D5C9-FF32-4263-831C-CEFD54258349}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B3\{B3C97407-F65B-46E1-A034-E275C9DC0C03}.eml
	  *EXTRA File 		    1315	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B5\{B592C064-4BE4-4385-BE4F-850816355033}.eml
	  *EXTRA File 		    1131	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B5\{B59C8B59-C06F-4AF1-BAC2-5F1ED3CE0010}.eml
	  *EXTRA File 		     713	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B5\{B5BB131B-D06B-45B5-87E0-A6722E27825B}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B8\{B884269A-47F6-4D7C-A8BA-2B3A94CBBCFD}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B9\{B9414EC0-B840-4937-95E7-6221FD176732}.eml
	  *EXTRA File 		    1279	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\B9\{B9B02F09-52D4-4E61-BE69-6C840FF3B520}.eml
	  *EXTRA File 		    1310	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BC\{BC0B5B08-CBEB-484D-B83C-590DA4FEEA6E}.eml
	  *EXTRA File 		    1098	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BC\{BC611BCB-C4DD-4DD8-BB09-4BC8ADF5AB82}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BC\{BC6A7239-E6D5-4483-8391-E7F76D2119D0}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BC\{BC9EFB19-8C1A-4B8F-9FA3-12F391D677D9}.eml
	  *EXTRA File 		    1119	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BC\{BCE293C5-27F5-465A-9340-8A71157B399A}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BD\{BD5D4BA5-5DA8-4A8B-B5BA-999C4303F984}.eml
	  *EXTRA File 		    4135	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BD\{BD83DA6E-AEF8-4FC6-96A2-9357297CBC5D}.eml
	  *EXTRA File 		    1130	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BD\{BDF2BC05-14CE-404C-89C6-0EB88DCD521E}.eml
	  *EXTRA File 		    1359	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\BE\{BE8ABFEA-4620-4356-9F33-22374EC96835}.eml
	  *EXTRA File 		   17138	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\C1\{C13CC274-967D-40B3-B78E-A3EE2E9D50D5}.eml
	  *EXTRA File 		    1111	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\C1\{C1B209F5-43E0-48EB-9934-FC100BAF3743}.eml
	  *EXTRA File 		     681	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\C4\{C473BA06-E679-42BD-BC66-E0045525476D}.eml
	    New File  		  127456	C:\HMS-DATA\Data\mydomain.tld\admin\C6\{C61145B4-CA48-4E74-93C6-E07CE0271AC0}.eml
	  *EXTRA File 		   19417	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\C7\{C739545C-0EEA-46CA-A241-90946D25EF66}.eml
	  *EXTRA File 		    7485	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\C8\{C83117CE-A2C1-4CE9-AA57-5362566E0E25}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\C9\{C9AC55C4-44A0-4786-B09D-4457AEEE0AA9}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CA\{CA5CE4FF-4993-48FE-BD23-91A4BEDFE508}.eml
	  *EXTRA File 		     605	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CB\{CBBFA01F-24A9-440F-88DA-C175B96DD64E}.eml
	  *EXTRA File 		    1311	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CC\{CC0DB726-85A8-4CDC-8E5C-BA9167430EFD}.eml
	  *EXTRA File 		    7486	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CC\{CCB90B07-6541-4050-A96F-BDBB1400DBA7}.eml
	  *EXTRA File 		   17138	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CD\{CD0688BA-A882-4834-A666-5D7DCAB979F9}.eml
	  *EXTRA File 		     661	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CD\{CDDB7AA7-55A3-4BC1-A344-5939B821894B}.eml
	  *EXTRA File 		     661	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CD\{CDFD3936-07A0-40AF-8922-745AAD765FBD}.eml
	  *EXTRA File 		     670	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\CE\{CE4E069D-E8E7-4F9A-8C39-2A37E6F245E4}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\D1\{D1EBE657-B2A7-40F0-A3AB-0962BBDBD368}.eml
	  *EXTRA File 		     711	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\D2\{D2890298-49BC-4FD4-A870-EFD86E8A83A1}.eml
	  *EXTRA File 		    2886	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\D3\{D37E4A1A-3097-46CA-9882-8C7AA3BB0487}.eml
	  *EXTRA File 		     636	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\D5\{D51A96BD-97D2-4DA9-8B90-4A31F1023408}.eml
	  *EXTRA File 		   17197	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\D7\{D7E081BF-BAF8-42AC-A851-67ABE999C484}.eml
	  *EXTRA File 		    1313	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\DA\{DA8A1846-1193-4395-896C-FFD9FB0FE2EE}.eml
	  *EXTRA File 		    1104	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\DC\{DC2C7C42-F135-4A2B-9BCB-05E914446946}.eml
	  *EXTRA File 		     425	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\DD\{DD6CF394-D940-479B-8E6D-B73ADDF5698C}.eml
	  *EXTRA File 		     679	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\DE\{DE4216DF-E073-46A3-8C6A-853BC7BDF2A3}.eml
	  *EXTRA File 		    1097	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E1\{E18863BC-5A36-4FE0-844E-FB73ED21E0C1}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E2\{E25E277E-3CD8-44E2-8729-43A190A3B400}.eml
	  *EXTRA File 		    1109	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E3\{E3395910-AC74-4410-8CF0-9BDCD4D8DE0D}.eml
	  *EXTRA File 		    1776	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E3\{E3B197AC-67C2-4133-9CDF-652D647A2BF7}.eml
	  *EXTRA File 		     638	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E4\{E4A8F1D6-A779-4A81-B1B4-2287478CE2FB}.eml
	  *EXTRA File 		    2834	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E5\{E51E802F-E35C-4524-AF10-72EB865E5F1B}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E5\{E5707A33-699F-4FED-9E05-E54734AE4592}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E6\{E63B4B33-744F-42C7-9800-E05C022A9C7B}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E6\{E66A114D-563A-4BBB-BBA5-8E480F23A70F}.eml
	  *EXTRA File 		    1278	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E7\{E73B260C-C508-4296-B18E-DE951DE5DC4E}.eml
	  *EXTRA File 		    1314	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E7\{E74668F6-8A83-4410-83EB-F630C0AA5FB9}.eml
	  *EXTRA File 		    7947	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E8\{E8BC86F2-BDDF-4FEE-B5A7-7E5827FC9B66}.eml
	  *EXTRA File 		   17092	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\E9\{E91F5BE9-03DE-40C6-BA6B-E4712CAAA130}.eml
	  *EXTRA File 		     678	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\EA\{EA8868A2-8C92-40F8-81E7-E9173390D75D}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\EB\{EB3C05FC-097E-4263-B085-457765522559}.eml
	  *EXTRA File 		     636	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\EC\{ECDEEBE7-F2BB-4E7E-97A3-F9F3ACD3C11A}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\EF\{EF0CB8D3-D4BD-4023-89F1-E446FE1F186C}.eml
	  *EXTRA File 		     604	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\EF\{EF921DA4-6320-4953-AD7F-E0D840EF9E3A}.eml
	  *EXTRA File 		    1311	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\F0\{F01EDCD8-9B9A-4BCB-B6FC-B6AB0886ED13}.eml
	  *EXTRA File 		    2481	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\F0\{F08E54E8-64E6-4168-A866-8B2B363D6614}.eml
	  *EXTRA File 		    2826	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\F4\{F4B864A1-008A-4490-B7B9-C28B70C9BDBE}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\F9\{F9B7817E-2B32-4916-8F40-359C54DB7B22}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\FB\{FB3DEB27-9BC9-40C0-8CA9-B26DC9648835}.eml
	  *EXTRA File 		    2514	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\FE\{FE2643B4-1BEE-4115-A395-AAA0B68677A6}.eml
	  *EXTRA File 		     564	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\FF\{FFB6AAAD-3323-4DBC-9286-EF799BB6C1C0}.eml
	  *EXTRA File 		     595	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\admin\FF\{FFC03488-9420-4D49-B579-25C3519863B0}.eml
	    New File  		   65423	C:\HMS-DATA\Data\mydomain.tld\user1\21\{2150BFB9-96E6-48F7-8E55-1E57E3DDAE14}.eml
	    New File  		   18054	C:\HMS-DATA\Data\mydomain.tld\user1\6D\{6D6437A9-244D-4DAC-9792-40686FC73726}.eml
	    New File  		    3875	C:\HMS-DATA\Data\mydomain.tld\user1\87\{87E389A2-698E-43D3-A8A7-37A46F4AFA4A}.eml
	    New File  		    9932	C:\HMS-DATA\Data\mydomain.tld\user1\94\{9490B0C4-7DCD-41A3-B791-611345EB57AC}.eml
	    New File  		    7539	C:\HMS-DATA\Data\mydomain.tld\user1\BE\{BE5CB371-5C2A-4987-ABC1-60F6AC6D1353}.eml
	    New File  		    8935	C:\HMS-DATA\Data\mydomain.tld\user2\08\{084BE539-2284-4769-8711-1F3C3930DC2E}.eml
	    New File  		   13721	C:\HMS-DATA\Data\mydomain.tld\user2\1A\{1AAB5BBF-354A-4A29-827D-9A5DE7EDFCB3}.eml
	    New File  		   31747	C:\HMS-DATA\Data\mydomain.tld\user2\36\{36C02EC4-A98D-4166-8EB8-7F2EDCC266A3}.eml
	    New File  		    3276	C:\HMS-DATA\Data\mydomain.tld\user2\7F\{7FE6F1AE-C356-4AD8-BABF-C941F1FD885A}.eml
	    New File  		   12866	C:\HMS-DATA\Data\mydomain.tld\user2\AE\{AE5D2F78-47D1-4F73-B3A4-423F5FA067E4}.eml
	    New File  		    3903	C:\HMS-DATA\Data\mydomain.tld\user2\BC\{BC8D90E7-E45D-49D0-8F14-314842C530DE}.eml
	    New File  		   14081	C:\HMS-DATA\Data\mydomain.tld\user2\E4\{E41F2BD5-DA99-4304-ADA2-88006D7C081E}.eml
	    New File  		   21387	C:\HMS-DATA\Data\mydomain.tld\user2\E7\{E7EF5B87-DCFE-4E53-8FE4-83F5794DA7E8}.eml
	    New File  		    8161	C:\HMS-DATA\Data\mydomain.tld\user2\F9\{F98BE496-61F5-4997-89EF-FE73951DE745}.eml
	    New File  		  102324	C:\HMS-DATA\Data\mydomain.tld\user3\19\{19C176B4-3332-4F9D-9CBC-427EFB241DD1}.eml
	    New File  		   32105	C:\HMS-DATA\Data\mydomain.tld\user3\3A\{3A2BE6B1-01BB-4E93-9791-4EFAD29BB007}.eml
	    New File  		   86277	C:\HMS-DATA\Data\mydomain.tld\user3\F0\{F0E8DFD2-AF21-4ADD-9BA7-9D980B613779}.eml
	    New File  		   32941	C:\HMS-DATA\Data\mydomain.tld\user4\0F\{0F21EB34-A65D-406C-B5CE-39E910BF71CB}.eml
	    New File  		   14292	C:\HMS-DATA\Data\mydomain.tld\user4\19\{196359E2-CD85-4303-A172-F40913323305}.eml
	    New File  		   33020	C:\HMS-DATA\Data\mydomain.tld\user4\65\{6569F01A-B40A-457D-8305-31B60A910640}.eml
	    New File  		   43345	C:\HMS-DATA\Data\mydomain.tld\user4\F8\{F829F0B7-EFF0-49F3-A64D-4C7C19C02838}.eml
	    New File  		   32670	C:\HMS-DATA\Data\mydomain.tld\user4\F8\{F8A7030C-6AA5-43BA-B368-ACB6DFC6C0FF}.eml
	    New File  		  145588	C:\HMS-DATA\Data\mydomain.tld\user4\78\{787E1CC5-EE82-45D6-8634-5D3E709989A7}.eml
	    New File  		   76095	C:\HMS-DATA\Data\mydomain.tld\user4\A6\{A6C7D849-311C-41F7-A181-CC8696D744F1}.eml
	  *EXTRA File 		   63669	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\user4\A7\{A7268534-C747-47D0-B0BB-77A8B1F0FC38}.eml
	  *EXTRA File 		   2.5 m	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\user4\BC\{BCB6DD46-4C05-4976-9874-FD938F4A9274}.eml
	  *EXTRA File 		   92206	C:\HMS-BACKUP-TEMP\hMailData\Data\mydomain.tld\user4\FF\{FF95BCFF-EA3E-4EC6-9C91-307D31708CFE}.eml
	    New File  		   32105	C:\HMS-DATA\Data\mydomain.tld\user6\01\{01D8E8AC-5563-45A4-A4F2-0590F099D43B}.eml
	    New File  		   25780	C:\HMS-DATA\Data\mydomain.tld\user6\1C\{1CC2796C-5C5B-4603-B392-659977754A7C}.eml
	    New File  		  140531	C:\HMS-DATA\Data\mydomain.tld\user6\67\{678DE828-3C8D-408B-8BF8-750B7CA6C004}.eml
	    New File  		    7962	C:\HMS-DATA\Data\mydomain.tld\user6\BE\{BE56500B-4DD5-457D-85D1-7AB7746A0E2E}.eml
	    New File  		   75840	C:\HMS-DATA\Data\mydomain.tld\user7\72\{72AE1A80-D93E-4586-B250-99D85EAF036B}.eml
	    New File  		   32421	C:\HMS-DATA\Data\mydomain.tld\user7\84\{84BC4726-9432-4CE5-83A9-4C1F176007A6}.eml
	    New File  		   37678	C:\HMS-DATA\Data\mydomain.tld\user7\8A\{8AA3A185-EDE9-4C4B-90DF-77005CC033B2}.eml
	    New File  		   19024	C:\HMS-DATA\Data\mydomain.tld\user7\8A\{8AE5AC45-B508-439A-BDF0-AEB4DAACB501}.eml

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :      5006         0      5006         0         0         0
   Files :     22792        35     22757         0         0       229
   Bytes :   4.238 g    1.30 m   4.237 g         0         0  786.58 m
   Times :   0:00:06   0:00:00                       0:00:00   0:00:06


   Speed :            91464400 Bytes/sec.
   Speed :            5233.634 MegaBytes/min.
   Ended : Thursday, October 29, 2020 11:59:01 PM


10/29/2020 11:59:01 PM : Finished backing up data dir in 6 seconds
10/29/2020 11:59:01 PM : ----------------------------
10/29/2020 11:59:01 PM : Deleting old MySQL database dump
10/29/2020 11:59:01 PM : Backing up MySQL
10/29/2020 11:59:22 PM : 
10/29/2020 11:59:22 PM : MySQL successfully dumped in 20 seconds
10/29/2020 11:59:22 PM : ----------------------------
10/29/2020 11:59:22 PM : Start SpamAssassin
10/29/2020 11:59:22 PM : SpamAssassin not running. Preparing to start service.
10/29/2020 11:59:22 PM : SpamAssassin starting up
10/29/2020 11:59:24 PM : SpamAssassin successfully started
10/29/2020 11:59:24 PM : ----------------------------
10/29/2020 11:59:24 PM : Start hMailServer
10/29/2020 11:59:24 PM : hMailServer not running. Preparing to start service.
10/29/2020 11:59:24 PM : hMailServer starting up
10/29/2020 11:59:24 PM : hMailServer successfully started
10/29/2020 11:59:25 PM : ----------------------------
10/29/2020 11:59:25 PM : Begin deleting old messages
10/29/2020 11:59:26 PM : Deleted 2 messages older than 30 days in admin@mydomain.tld > APCUPSD
10/29/2020 11:59:26 PM : Deleted 5 messages older than 30 days in admin@mydomain.tld > SAUserList
10/29/2020 11:59:26 PM : Deleted 2 messages older than 30 days in admin@mydomain.tld > ServerMessages
10/29/2020 11:59:26 PM : Deleted 3 messages older than 30 days in user1@mydomain.tld > Trash
10/29/2020 11:59:26 PM : Deleted 1 messages older than 30 days in user2@mydomain.tld > Trash > Dingbat > test
10/29/2020 11:59:27 PM : Finished deleting 13 messages in 2 seconds
10/29/2020 11:59:28 PM : ----------------------------
10/29/2020 11:59:28 PM : Create archive : 2020-10-29-hMailServer
10/29/2020 11:59:28 PM : Archive folder : C:\HMS-BACKUP-TEMP
10/30/2020 1:42:17 AM : 
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive:
5006 folders, 22793 files, 5378623607 bytes (5130 MiB)

Creating archive: C:\HMS-BACKUP\2020-10-29-hMailServer\2020-10-29-hMailServer.7z

Add new data to archive: 5006 folders, 22793 files, 5378623607 bytes (5130 MiB)


Files read from disk: 22793
Archive size: 2670391942 bytes (2547 MiB)
Everything is Ok

10/30/2020 1:42:17 AM : Archive creation finished in 1 hour 42 minutes 49 seconds
10/30/2020 1:42:17 AM : Wait a few seconds to make sure archive is finished
10/30/2020 1:42:21 AM : ----------------------------
10/30/2020 1:42:21 AM : Begin offsite upload process
10/30/2020 1:42:21 AM : Getting access token from LetsUpload
10/30/2020 1:42:24 AM : Access Token : <redacted>
10/30/2020 1:42:24 AM : Account ID   : <redacted>
10/30/2020 1:42:24 AM : ----------------------------
10/30/2020 1:42:24 AM : Creating Folder 2020-10-29-hMailServer at LetsUpload
10/30/2020 1:42:24 AM : Folder ID  : <redacted>
10/30/2020 1:42:24 AM : Folder URL : https://letsupload.io/folder/<redacted>/2020-10-29-hMailServer
10/30/2020 1:42:24 AM : ----------------------------
10/30/2020 1:42:24 AM : Begin uploading files to LetsUpload
10/30/2020 1:42:24 AM : There are 26 files to upload
10/30/2020 1:42:24 AM : ----------------------------
10/30/2020 1:42:24 AM : Encoding file 2020-10-29-hMailServer.7z.001
10/30/2020 1:42:26 AM : Finished encoding file in 1 second
10/30/2020 1:42:41 AM : Uploading 2020-10-29-hMailServer.7z.001 - 1 of 26
10/30/2020 1:44:17 AM : Upload try 1
10/30/2020 1:44:17 AM : Response : File uploaded
10/30/2020 1:44:17 AM : File ID  : <redacted>
10/30/2020 1:44:17 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:44:17 AM : Size     : 100 MB
10/30/2020 1:44:17 AM : Status   : success
10/30/2020 1:44:17 AM : Finished uploading file in 1 minute 35 seconds
10/30/2020 1:44:17 AM : ----------------------------
10/30/2020 1:44:17 AM : Encoding file 2020-10-29-hMailServer.7z.002
10/30/2020 1:44:22 AM : Finished encoding file in 4 seconds
10/30/2020 1:44:30 AM : Uploading 2020-10-29-hMailServer.7z.002 - 2 of 26
10/30/2020 1:45:58 AM : Upload try 1
10/30/2020 1:45:58 AM : Response : File uploaded
10/30/2020 1:45:58 AM : File ID  : <redacted>
10/30/2020 1:45:58 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:45:58 AM : Size     : 100 MB
10/30/2020 1:45:58 AM : Status   : success
10/30/2020 1:45:58 AM : Finished uploading file in 1 minute 27 seconds
10/30/2020 1:45:59 AM : ----------------------------
10/30/2020 1:45:59 AM : Encoding file 2020-10-29-hMailServer.7z.003
10/30/2020 1:45:59 AM : Finished encoding file in less than 1 second
10/30/2020 1:46:04 AM : Uploading 2020-10-29-hMailServer.7z.003 - 3 of 26
10/30/2020 1:46:55 AM : Upload try 1
10/30/2020 1:46:55 AM : Response : File uploaded
10/30/2020 1:46:55 AM : File ID  : <redacted>
10/30/2020 1:46:55 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:46:55 AM : Size     : 100 MB
10/30/2020 1:46:55 AM : Status   : success
10/30/2020 1:46:55 AM : Finished uploading file in 50 seconds
10/30/2020 1:46:55 AM : ----------------------------
10/30/2020 1:46:55 AM : Encoding file 2020-10-29-hMailServer.7z.004
10/30/2020 1:46:56 AM : Finished encoding file in less than 1 second
10/30/2020 1:46:59 AM : Uploading 2020-10-29-hMailServer.7z.004 - 4 of 26
10/30/2020 1:47:16 AM : Upload try 1
10/30/2020 1:47:16 AM : Response : File uploaded
10/30/2020 1:47:16 AM : File ID  : <redacted>
10/30/2020 1:47:16 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:47:16 AM : Size     : 100 MB
10/30/2020 1:47:16 AM : Status   : success
10/30/2020 1:47:16 AM : Finished uploading file in 17 seconds
10/30/2020 1:47:16 AM : ----------------------------
10/30/2020 1:47:16 AM : Encoding file 2020-10-29-hMailServer.7z.005
10/30/2020 1:47:17 AM : Finished encoding file in less than 1 second
10/30/2020 1:47:17 AM : Uploading 2020-10-29-hMailServer.7z.005 - 5 of 26
10/30/2020 1:47:52 AM : Upload try 1
10/30/2020 1:47:53 AM : Response : File uploaded
10/30/2020 1:47:53 AM : File ID  : <redacted>
10/30/2020 1:47:53 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:47:53 AM : Size     : 100 MB
10/30/2020 1:47:53 AM : Status   : success
10/30/2020 1:47:53 AM : Finished uploading file in 35 seconds
10/30/2020 1:47:53 AM : ----------------------------
10/30/2020 1:47:53 AM : Encoding file 2020-10-29-hMailServer.7z.006
10/30/2020 1:48:02 AM : Finished encoding file in 9 seconds
10/30/2020 1:48:09 AM : Uploading 2020-10-29-hMailServer.7z.006 - 6 of 26
10/30/2020 1:49:17 AM : Upload try 1
10/30/2020 1:49:17 AM : Response : File uploaded
10/30/2020 1:49:17 AM : File ID  : <redacted>
10/30/2020 1:49:17 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:49:18 AM : Size     : 100 MB
10/30/2020 1:49:18 AM : Status   : success
10/30/2020 1:49:18 AM : Finished uploading file in 1 minute 8 seconds
10/30/2020 1:49:18 AM : ----------------------------
10/30/2020 1:49:18 AM : Encoding file 2020-10-29-hMailServer.7z.007
10/30/2020 1:49:22 AM : Finished encoding file in 3 seconds
10/30/2020 1:49:44 AM : Uploading 2020-10-29-hMailServer.7z.007 - 7 of 26
10/30/2020 1:50:21 AM : Upload try 1
10/30/2020 1:50:21 AM : Response : File uploaded
10/30/2020 1:50:21 AM : File ID  : <redacted>
10/30/2020 1:50:21 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:50:21 AM : Size     : 100 MB
10/30/2020 1:50:21 AM : Status   : success
10/30/2020 1:50:21 AM : Finished uploading file in 37 seconds
10/30/2020 1:50:21 AM : ----------------------------
10/30/2020 1:50:21 AM : Encoding file 2020-10-29-hMailServer.7z.008
10/30/2020 1:50:22 AM : Finished encoding file in less than 1 second
10/30/2020 1:50:35 AM : Uploading 2020-10-29-hMailServer.7z.008 - 8 of 26
10/30/2020 1:51:22 AM : Upload try 1
10/30/2020 1:51:22 AM : Response : File uploaded
10/30/2020 1:51:22 AM : File ID  : <redacted>
10/30/2020 1:51:22 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:51:22 AM : Size     : 100 MB
10/30/2020 1:51:22 AM : Status   : success
10/30/2020 1:51:22 AM : Finished uploading file in 45 seconds
10/30/2020 1:51:22 AM : ----------------------------
10/30/2020 1:51:22 AM : Encoding file 2020-10-29-hMailServer.7z.009
10/30/2020 1:51:23 AM : Finished encoding file in less than 1 second
10/30/2020 1:51:38 AM : Uploading 2020-10-29-hMailServer.7z.009 - 9 of 26
10/30/2020 1:52:08 AM : Upload try 1
10/30/2020 1:52:09 AM : Response : File uploaded
10/30/2020 1:52:09 AM : File ID  : <redacted>
10/30/2020 1:52:09 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:52:09 AM : Size     : 100 MB
10/30/2020 1:52:09 AM : Status   : success
10/30/2020 1:52:09 AM : Finished uploading file in 30 seconds
10/30/2020 1:52:09 AM : ----------------------------
10/30/2020 1:52:09 AM : Encoding file 2020-10-29-hMailServer.7z.010
10/30/2020 1:52:09 AM : Finished encoding file in less than 1 second
10/30/2020 1:52:24 AM : Uploading 2020-10-29-hMailServer.7z.010 - 10 of 26
10/30/2020 1:52:50 AM : Upload try 1
10/30/2020 1:52:50 AM : [ERROR]  : The underlying connection was closed: An unexpected error occurred on a send.
10/30/2020 1:54:02 AM : Upload try 2
10/30/2020 1:54:03 AM : Response : File uploaded
10/30/2020 1:54:03 AM : File ID  : <redacted>
10/30/2020 1:54:03 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:54:03 AM : Size     : 100 MB
10/30/2020 1:54:03 AM : Status   : success
10/30/2020 1:54:03 AM : Finished uploading file in 1 minute 38 seconds
10/30/2020 1:54:03 AM : ----------------------------
10/30/2020 1:54:03 AM : Encoding file 2020-10-29-hMailServer.7z.011
10/30/2020 1:54:04 AM : Finished encoding file in less than 1 second
10/30/2020 1:54:22 AM : Uploading 2020-10-29-hMailServer.7z.011 - 11 of 26
10/30/2020 1:55:08 AM : Upload try 1
10/30/2020 1:55:09 AM : Response : File uploaded
10/30/2020 1:55:09 AM : File ID  : <redacted>
10/30/2020 1:55:09 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:55:09 AM : Size     : 100 MB
10/30/2020 1:55:09 AM : Status   : success
10/30/2020 1:55:09 AM : Finished uploading file in 45 seconds
10/30/2020 1:55:09 AM : ----------------------------
10/30/2020 1:55:09 AM : Encoding file 2020-10-29-hMailServer.7z.012
10/30/2020 1:55:10 AM : Finished encoding file in 1 second
10/30/2020 1:55:27 AM : Uploading 2020-10-29-hMailServer.7z.012 - 12 of 26
10/30/2020 1:56:18 AM : Upload try 1
10/30/2020 1:56:19 AM : Response : File uploaded
10/30/2020 1:56:19 AM : File ID  : <redacted>
10/30/2020 1:56:19 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:56:19 AM : Size     : 100 MB
10/30/2020 1:56:19 AM : Status   : success
10/30/2020 1:56:19 AM : Finished uploading file in 51 seconds
10/30/2020 1:56:19 AM : ----------------------------
10/30/2020 1:56:19 AM : Encoding file 2020-10-29-hMailServer.7z.013
10/30/2020 1:56:28 AM : Finished encoding file in 8 seconds
10/30/2020 1:57:00 AM : Uploading 2020-10-29-hMailServer.7z.013 - 13 of 26
10/30/2020 1:57:33 AM : Upload try 1
10/30/2020 1:57:33 AM : Response : File uploaded
10/30/2020 1:57:33 AM : File ID  : <redacted>
10/30/2020 1:57:33 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:57:33 AM : Size     : 100 MB
10/30/2020 1:57:33 AM : Status   : success
10/30/2020 1:57:34 AM : Finished uploading file in 32 seconds
10/30/2020 1:57:34 AM : ----------------------------
10/30/2020 1:57:34 AM : Encoding file 2020-10-29-hMailServer.7z.014
10/30/2020 1:58:00 AM : Finished encoding file in 25 seconds
10/30/2020 1:58:01 AM : Uploading 2020-10-29-hMailServer.7z.014 - 14 of 26
10/30/2020 1:58:57 AM : Upload try 1
10/30/2020 1:58:58 AM : Response : File uploaded
10/30/2020 1:58:58 AM : File ID  : <redacted>
10/30/2020 1:58:58 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 1:58:58 AM : Size     : 100 MB
10/30/2020 1:58:58 AM : Status   : success
10/30/2020 1:58:58 AM : Finished uploading file in 56 seconds
10/30/2020 1:58:58 AM : ----------------------------
10/30/2020 1:58:58 AM : Encoding file 2020-10-29-hMailServer.7z.015
10/30/2020 1:58:59 AM : Finished encoding file in less than 1 second
10/30/2020 1:59:13 AM : Uploading 2020-10-29-hMailServer.7z.015 - 15 of 26
10/30/2020 2:00:00 AM : Upload try 1
10/30/2020 2:00:01 AM : Response : File uploaded
10/30/2020 2:00:01 AM : File ID  : <redacted>
10/30/2020 2:00:01 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:00:01 AM : Size     : 100 MB
10/30/2020 2:00:01 AM : Status   : success
10/30/2020 2:00:01 AM : Finished uploading file in 46 seconds
10/30/2020 2:00:01 AM : ----------------------------
10/30/2020 2:00:01 AM : Encoding file 2020-10-29-hMailServer.7z.016
10/30/2020 2:00:02 AM : Finished encoding file in less than 1 second
10/30/2020 2:00:22 AM : Uploading 2020-10-29-hMailServer.7z.016 - 16 of 26
10/30/2020 2:00:56 AM : Upload try 1
10/30/2020 2:00:56 AM : Response : File uploaded
10/30/2020 2:00:56 AM : File ID  : <redacted>
10/30/2020 2:00:56 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:00:56 AM : Size     : 100 MB
10/30/2020 2:00:56 AM : Status   : success
10/30/2020 2:00:56 AM : Finished uploading file in 30 seconds
10/30/2020 2:00:56 AM : ----------------------------
10/30/2020 2:00:56 AM : Encoding file 2020-10-29-hMailServer.7z.017
10/30/2020 2:01:10 AM : Finished encoding file in 13 seconds
10/30/2020 2:01:13 AM : Uploading 2020-10-29-hMailServer.7z.017 - 17 of 26
10/30/2020 2:02:17 AM : Upload try 1
10/30/2020 2:02:17 AM : Response : File uploaded
10/30/2020 2:02:17 AM : File ID  : <redacted>
10/30/2020 2:02:17 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:02:17 AM : Size     : 100 MB
10/30/2020 2:02:17 AM : Status   : success
10/30/2020 2:02:17 AM : Finished uploading file in 58 seconds
10/30/2020 2:02:17 AM : ----------------------------
10/30/2020 2:02:17 AM : Encoding file 2020-10-29-hMailServer.7z.018
10/30/2020 2:02:18 AM : Finished encoding file in less than 1 second
10/30/2020 2:02:24 AM : Uploading 2020-10-29-hMailServer.7z.018 - 18 of 26
10/30/2020 2:03:21 AM : Upload try 1
10/30/2020 2:03:21 AM : Response : File uploaded
10/30/2020 2:03:21 AM : File ID  : <redacted>
10/30/2020 2:03:21 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:03:21 AM : Size     : 100 MB
10/30/2020 2:03:21 AM : Status   : success
10/30/2020 2:03:21 AM : Finished uploading file in 55 seconds
10/30/2020 2:03:22 AM : ----------------------------
10/30/2020 2:03:23 AM : Encoding file 2020-10-29-hMailServer.7z.019
10/30/2020 2:03:32 AM : Finished encoding file in 7 seconds
10/30/2020 2:03:55 AM : Uploading 2020-10-29-hMailServer.7z.019 - 19 of 26
10/30/2020 2:04:32 AM : Upload try 1
10/30/2020 2:04:32 AM : Response : File uploaded
10/30/2020 2:04:32 AM : File ID  : <redacted>
10/30/2020 2:04:32 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:04:32 AM : Size     : 100 MB
10/30/2020 2:04:32 AM : Status   : success
10/30/2020 2:04:32 AM : Finished uploading file in 36 seconds
10/30/2020 2:04:32 AM : ----------------------------
10/30/2020 2:04:32 AM : Encoding file 2020-10-29-hMailServer.7z.020
10/30/2020 2:04:33 AM : Finished encoding file in less than 1 second
10/30/2020 2:04:37 AM : Uploading 2020-10-29-hMailServer.7z.020 - 20 of 26
10/30/2020 2:05:01 AM : Upload try 1
10/30/2020 2:05:05 AM : [ERROR]  : The underlying connection was closed: An unexpected error occurred on a send.
10/30/2020 2:05:46 AM : Upload try 2
10/30/2020 2:05:46 AM : Response : File uploaded
10/30/2020 2:05:46 AM : File ID  : <redacted>
10/30/2020 2:05:46 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:05:46 AM : Size     : 100 MB
10/30/2020 2:05:46 AM : Status   : success
10/30/2020 2:05:46 AM : Finished uploading file in 1 minute 9 seconds
10/30/2020 2:05:47 AM : ----------------------------
10/30/2020 2:05:47 AM : Encoding file 2020-10-29-hMailServer.7z.021
10/30/2020 2:05:50 AM : Finished encoding file in 3 seconds
10/30/2020 2:06:14 AM : Uploading 2020-10-29-hMailServer.7z.021 - 21 of 26
10/30/2020 2:06:36 AM : Upload try 1
10/30/2020 2:06:36 AM : Response : File uploaded
10/30/2020 2:06:36 AM : File ID  : <redacted>
10/30/2020 2:06:36 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:06:36 AM : Size     : 100 MB
10/30/2020 2:06:36 AM : Status   : success
10/30/2020 2:06:36 AM : Finished uploading file in 21 seconds
10/30/2020 2:06:36 AM : ----------------------------
10/30/2020 2:06:36 AM : Encoding file 2020-10-29-hMailServer.7z.022
10/30/2020 2:06:41 AM : Finished encoding file in 5 seconds
10/30/2020 2:06:48 AM : Uploading 2020-10-29-hMailServer.7z.022 - 22 of 26
10/30/2020 2:07:11 AM : Upload try 1
10/30/2020 2:07:11 AM : Response : File uploaded
10/30/2020 2:07:11 AM : File ID  : <redacted>
10/30/2020 2:07:11 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:07:11 AM : Size     : 100 MB
10/30/2020 2:07:11 AM : Status   : success
10/30/2020 2:07:11 AM : Finished uploading file in 20 seconds
10/30/2020 2:07:11 AM : ----------------------------
10/30/2020 2:07:11 AM : Encoding file 2020-10-29-hMailServer.7z.023
10/30/2020 2:07:12 AM : Finished encoding file in less than 1 second
10/30/2020 2:07:13 AM : Uploading 2020-10-29-hMailServer.7z.023 - 23 of 26
10/30/2020 2:07:38 AM : Upload try 1
10/30/2020 2:07:38 AM : Response : File uploaded
10/30/2020 2:07:38 AM : File ID  : <redacted>
10/30/2020 2:07:38 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:07:38 AM : Size     : 100 MB
10/30/2020 2:07:38 AM : Status   : success
10/30/2020 2:07:38 AM : Finished uploading file in 25 seconds
10/30/2020 2:07:38 AM : ----------------------------
10/30/2020 2:07:38 AM : Encoding file 2020-10-29-hMailServer.7z.024
10/30/2020 2:07:40 AM : Finished encoding file in 2 seconds
10/30/2020 2:08:06 AM : Uploading 2020-10-29-hMailServer.7z.024 - 24 of 26
10/30/2020 2:08:36 AM : Upload try 1
10/30/2020 2:08:36 AM : Response : File uploaded
10/30/2020 2:08:36 AM : File ID  : <redacted>
10/30/2020 2:08:36 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:08:36 AM : Size     : 100 MB
10/30/2020 2:08:36 AM : Status   : success
10/30/2020 2:08:36 AM : Finished uploading file in 29 seconds
10/30/2020 2:08:36 AM : ----------------------------
10/30/2020 2:08:36 AM : Encoding file 2020-10-29-hMailServer.7z.025
10/30/2020 2:08:38 AM : Finished encoding file in 2 seconds
10/30/2020 2:08:39 AM : Uploading 2020-10-29-hMailServer.7z.025 - 25 of 26
10/30/2020 2:08:59 AM : Upload try 1
10/30/2020 2:08:59 AM : Response : File uploaded
10/30/2020 2:08:59 AM : File ID  : <redacted>
10/30/2020 2:08:59 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:08:59 AM : Size     : 100 MB
10/30/2020 2:08:59 AM : Status   : success
10/30/2020 2:08:59 AM : Finished uploading file in 19 seconds
10/30/2020 2:08:59 AM : ----------------------------
10/30/2020 2:08:59 AM : Encoding file 2020-10-29-hMailServer.7z.026
10/30/2020 2:09:00 AM : Finished encoding file in less than 1 second
10/30/2020 2:09:00 AM : Uploading 2020-10-29-hMailServer.7z.026 - 26 of 26
10/30/2020 2:09:10 AM : Upload try 1
10/30/2020 2:09:10 AM : Response : File uploaded
10/30/2020 2:09:10 AM : File ID  : <redacted>
10/30/2020 2:09:10 AM : URL      : https://letsupload.io/<redacted>
10/30/2020 2:09:10 AM : Size     : 46.68 MB
10/30/2020 2:09:10 AM : Status   : success
10/30/2020 2:09:10 AM : Finished uploading file in 9 seconds
10/30/2020 2:09:10 AM : ----------------------------
10/30/2020 2:09:10 AM : Finished offsite upload process in 26 minutes 49 seconds
10/30/2020 2:09:10 AM : ----------------------------
10/30/2020 2:09:10 AM : Counting uploaded files at LetsUpload
10/30/2020 2:09:10 AM : There are 26 files in the remote folder
10/30/2020 2:09:10 AM : ----------------------------
10/30/2020 2:09:10 AM : Finished uploading 26 files in 26 minutes 45 seconds
10/30/2020 2:09:10 AM : Upload sucessful. 26 files uploaded to https://letsupload.io/folder/<redacted>/2020-10-29-hMailServer
10/30/2020 2:09:10 AM : hMailServer Backup & Upload routine completed in 2 hours 11 minutes 6 seconds


palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-02 14:11

Updated message pruning script to look down all subfolder levels that exist. Also deletes empty subfolders of matching folders.

See here for testing: https://hmailserver.com/forum/viewtopic.php?f=9&t=35463

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-04 13:36

Added choice of plain text or html email report. Html has fancy schmancy colors green, yellow and red for OK, INFO and ERROR.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-06 00:40

Added a download script that will download all archive volumes of the last backup to a specified folder.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-21 15:01

Added Bayes training using SpamAssassin SpamC

https://github.com/palinkas-jo-reggelt/ ... ite_Backup

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-21 20:32

If $HTML is enabled, you get a nice color message email. No errors here, but they are in red if they exist.

I went to great lengths to make the email display properly (no line wrapping) on mobile view. Maybe that's a silly small thing, but that's how I look at the message in the morning and I want to see all of it without scrolling. It makes errors stand out when I'm still drinking my coffee. :wink: Plus, its easier to read.
Screenshot 2020-11-21 132310.png
52 minutes for about 5gb of data. Most of that time is spent making the archive. I added a switch to create a non-password protected zip if you don't care about uploading to letsupload. In that case, it should only be a few minutes for the entire thing.

Also, I don't know why, but calling 7-zip from the system path is about 3-4 times faster than calling it from its absolute file path to the executable. There's a switch to choose, but putting it in the system path is recommended.

User avatar
jimimaseye
Moderator
Moderator
Posts: 10060
Joined: 2011-09-08 17:48

Re: hMailServer Offsite Backup

Post by jimimaseye » 2020-11-22 10:56

I love a nice clean fresh 'pdate'. Sad when we don't get one. 😉

(Arent there special parties for these things?)

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-22 19:44

jimimaseye wrote:
2020-11-22 10:56
I love a nice clean fresh 'pdate'. Sad when we don't get one. 😉

(Arent there special parties for these things?)

[Entered by mobile. Excuse my spelling.]
What's a pdate?

User avatar
RvdH
Senior user
Senior user
Posts: 3235
Joined: 2008-06-27 14:42
Location: The Netherlands

Re: hMailServer Offsite Backup

Post by RvdH » 2020-11-22 20:24

"[INFO] No fresh pdates available" :lol: :mrgreen:
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2020-11-22 20:25

Screenshot 2020-11-21 132310.png
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-11-22 20:47

typo, schmypo... :mrgreen:

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2020-11-22 20:55

Image
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-12-17 15:00

Lots of changes. I think we're well past alpha at this point. Too many to list - don't care about remembering. The "big" ones:

* Mulitple checks on files uploaded to make sure the dang thing actually gets uploaded exactly as intended - checks status, size; if any differences, it deletes the remote file and starts over. So far that's happened to me only once, but at least I know it works. :D The last thing you want is to need the backup files and find out its corrupt because one of them didn't upload properly.
* I added a version check, which will let you know in the report email whether an update is available.

[/shamelessselfpromotion] :mrgreen:

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2020-12-17 15:39

Hmm...

We need something like this -> https://www.phpbb.com/community/viewtop ... &t=1690905
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-12-17 15:45

SorenR wrote:
2020-12-17 15:39
Hmm...

We need something like this -> https://www.phpbb.com/community/viewtop ... &t=1690905
You can always just use emoji.

👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍🤩

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-12-17 15:53

One other thing i found out when i had to actually use the backup last month after server crash :roll: was that there is a bug with powershell+mysqldump. For some reason, it encodes the dump file in something other than utf8 so it would not restore. I fixed my immediate issue by changing the encoding in notepad++, but i found a real solution and changed the script. If my server didn't crash, i would never have known.

The answer is instead of "> dumpfilename.sql" you have to use "--result-file=dumpfilename.sql" in the dump command.

Edit:

https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html

Note
A dump made using PowerShell on Windows with output redirection creates a file that has UTF-16 encoding:

shell> mysqldump [options] > dump.sql

However, UTF-16 is not permitted as a connection character set (see Impermissible Client Character Sets), so the dump file cannot be loaded correctly. To work around this issue, use the --result-file option, which creates the output in ASCII format:

shell> mysqldump [options] --result-file=dump.sql

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2020-12-20 15:59

Letsupload.io is down, so last night's run failed at attempting to obtain access token (first step of upload process). Even though the entire site is down, I realized in other circumstances there could be temporary network errors. I have already accounted for that during the file upload process, with error checking and multiple tries before giving up. This morning I added that same redundancy to the rest of the process: obtaining access token and remote folder creation.

Also, there is a switch for uploading in the config file, so you can choose to skip it altogether if you don't want to put your data online - even if its protected by AES-256 encryption. :D

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-08 12:27

Trying to implement NAS Backup in your Backup Script, need help if it is correct location I am putting the code or Shall I Put it somewhere else.

I am trying to copy the Backup zips from ||$BackupLocation = "C:\HMS-BACKUP" || to my NAS,

I am putting the code in "HMailserverBackup.ps1"

right after the section <# Backup Miscellaneous Files #>

Code: Select all


<#  Backup to NAS Backup Location $NASBackupLocation #>
$NASBackupLocation	   = "\\MY.NAS.IP.HERE\HMS_Backup"

$BackupSuccess = 0
$BeginRobocopy = Get-Date
Try {
	NET USE $NASBackupLocation
	$RoboCopy = & robocopy $BackupLocation $NASBackupLocation /mir /ndl /r:43200 /np /w:1 | Out-String
	Debug $RoboCopy
	Debug "Finished uploading up to NAS in $(ElapsedTime $BeginRobocopy)"
	$RoboStats = $RoboCopy.Split([Environment]::NewLine) | Where-Object {$_ -match 'Files\s:\s+\d'} 
	$RoboStats | ConvertFrom-String -Delimiter "\s+" -PropertyNames Nothing, Files, Colon, Total, Copied, Skipped, Mismatch, Failed, Extras | ForEach {
		$Copied = $_.Copied
		$Mismatch = $_.Mismatch
		$Failed = $_.Failed
		$Extras = $_.Extras
	}
	NET USE $NASBackupLocation /D
	If (($Mismatch -gt 0) -or ($Failed -gt 0)){
		Throw "Robocopy to NAS MISMATCH or FAILED exists"
	}
	$BackupSuccess++
	NET USE $NASBackupLocation /D
	Debug "Robocopy backup to NAS success: $Copied new, $Extras deleted, $Mismatch mismatched, $Failed failed"
	Email "[OK] NAS Backup: $Copied new, $Extras del"
}
Catch {
	Debug "[ERROR] RoboCopy NAS Backup: $($Error[0])"
	Email "[ERROR] RoboCopy NAS Backup: Check Debug Log"
}
Also need little more info for below section.

After cycling logs and Before Pruning the logs I want to zip old logs to be saved in yearly archive(HMS_Logs_YYYY.ZIP) in Separate Backup location and save for last 2 years. Tried to modify your 7zip code for that but failed :oops:
can you help please.

Currently I am using batch file to do that but since this function is available in your script I thought of adding this function in it.
Cyclelogs.bat

Code: Select all

REM https://www.hmailserver.com/forum/viewtopic.php?f=9&t=33003&p=206129&hilit=cycle+logs#p206129
Echo Off

IF NOT EXIST "C:\Program Files (x86)\hMailServer\Logs\hmailserver_events.log" GOTO NOEXIST

:RENAME
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j
REM Suggestion from jimimaseye
REM ren "C:\Program Files (x86)\hMailServer\Logs\hmailserver_events.log" hmailserver_events_%ldt:~0,8%.log"

ren "C:\Program Files (x86)\hMailServer\Logs\hmailserver_events.log" hmailserver_events_%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%.log"
GOTO END

:NOEXIST
ECHO NO FILE EXISTS

:END
]
LogArchive.bat

Code: Select all

@ECHO OFF
set path="C:\Program Files\WinRAR\";
rar a -df -m5 -ag-YYYY -to5d "C:\HMS-Log-Archive\hmail_log.rar" "C:\Program Files (x86)\hMailServer\Logs"
IF %ERRORLEVEL% == 0 (ECHO %date%, %time% : Backup succeeded >> "C:\HMS-Log-Archive\Data_Backup_Log.log") 
ELSE (IF %ERRORLEVEL% == 1 
(ECHO %date%, %time% : Error: Backup succeeded with warnings, or NO file to backup >> "C:\HMS-Log-Archive\Data_Backup_Log.log")
ELSE (ECHO %date%, %time% : Warning: Backup failed >> "C:\HMS-Log-Archive\Data_Backup_Log.log" ))

Please ignore my Ignorance but I am no programmer but learning from the forum. :D

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-08 14:10

gotspatel wrote:
2021-01-08 12:27
Please ignore my Ignorance but I am no programmer but learning from the forum. :D
That was me not long ago. :D

Sorry, but you caught me at a bad time. I have to go away for the weekend with no computer, so I won't be able to get to much until Monday, but I have a couple of minutes now, so... :D

For the log cycling, just leave everything as is. Fill out the variables in the config and let it do its thing. It should just work. As to zipping the log files, try copying the 7z function and adding it to hMailServerBackup.ps1 below the section for cycling logs. Then just set the location you want to store the zipped log files. There's no need for password protection here, I think, so I stripped that out. Its much faster without it.

Code: Select all

<#  Zip log files  #>
$StartLogFileArchive = Get-Date
Debug "----------------------------"
Debug "Archiving Log Files"
$SevenZipExe = "$SevenZipDir\7z.exe"
$LogFileBackup = "C:\Path\to\logfilebackup\storage\dir"
$LogFileBackupName = "hMSLogs-$((Get-Date).ToString('yyyy-MM-dd')"
Try {
	If ($SevenZipInSystemPath) {
		$SevenZip = & cmd /c 7z a -tzip "$LogFileBackup\$LogFileBackupName.zip" "$hMSDir\Logs\*" | Out-String
	} Else {
		$SevenZip = & cmd /c $SevenZipExe a -tzip "$LogFileBackup\$LogFileBackupName.zip" "$hMSDir\Logs\*" | Out-String
	}
	Debug $SevenZip
	Debug "Log Backup Archive creation finished in $(ElapsedTime $StartLogFileArchive)"
	Email "[OK] Log archive created"
}
Catch {
	Debug "[ERROR] Log Archive Creation : $($Error[0])"
	Email "[ERROR] Log Archive Creation : Check Debug Log"
	Email "[ERROR] Log Archive Creation : $($Error[0])"
	EmailResults
	Exit
}
Trying to implement NAS Backup in your Backup Script, need help if it is correct location I am putting the code or Shall I Put it somewhere else.

I am trying to copy the Backup zips from ||$BackupLocation = "C:\HMS-BACKUP" || to my NAS,

I am putting the code in "HMailserverBackup.ps1"

right after the section <# Backup Miscellaneous Files #>
I need to more fully understand what you're trying to do here.

Are you trying to copy your 7z archived data-dir files to the NAS?

I think using robocopy is the wrong strategy. You can just copy the files using Copy-Item in powershell. It might work better if you map a drive to your NAS share.

That's all the time I have at the moment, but you can experiment by copying and using the "Backup Miscellaneous Files" section from "HMailserverBackup.ps1". If you can't work it out, I'll help you when I get back next week.

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-08 14:26

palinka wrote:
2021-01-08 14:10
gotspatel wrote:
2021-01-08 12:27
Please ignore my Ignorance but I am no programmer but learning from the forum. :D
That was me not long ago. :D

Sorry, but you caught me at a bad time. I have to go away for the weekend with no computer, so I won't be able to get to much until Monday, but I have a couple of minutes now, so... :D

For the log cycling, just leave everything as is. Fill out the variables in the config and let it do its thing. It should just work. As to zipping the log files, try copying the 7z function and adding it to hMailServerBackup.ps1 below the section for cycling logs. Then just set the location you want to store the zipped log files. There's no need for password protection here, I think, so I stripped that out. Its much faster without it.

Code: Select all

<#  Zip log files  #>
$StartLogFileArchive = Get-Date
Debug "----------------------------"
Debug "Archiving Log Files"
$SevenZipExe = "$SevenZipDir\7z.exe"
$LogFileBackup = "C:\Path\to\logfilebackup\storage\dir"
$LogFileBackupName = "hMSLogs-$((Get-Date).ToString('yyyy-MM-dd')"
Try {
	If ($SevenZipInSystemPath) {
		$SevenZip = & cmd /c 7z a -tzip "$LogFileBackup\$LogFileBackupName.zip" "$hMSDir\Logs\*" | Out-String
	} Else {
		$SevenZip = & cmd /c $SevenZipExe a -tzip "$LogFileBackup\$LogFileBackupName.zip" "$hMSDir\Logs\*" | Out-String
	}
	Debug $SevenZip
	Debug "Log Backup Archive creation finished in $(ElapsedTime $StartLogFileArchive)"
	Email "[OK] Log archive created"
}
Catch {
	Debug "[ERROR] Log Archive Creation : $($Error[0])"
	Email "[ERROR] Log Archive Creation : Check Debug Log"
	Email "[ERROR] Log Archive Creation : $($Error[0])"
	EmailResults
	Exit
}
Trying to implement NAS Backup in your Backup Script, need help if it is correct location I am putting the code or Shall I Put it somewhere else.

I am trying to copy the Backup zips from ||$BackupLocation = "C:\HMS-BACKUP" || to my NAS,

I am putting the code in "HMailserverBackup.ps1"

right after the section <# Backup Miscellaneous Files #>
I need to more fully understand what you're trying to do here.

Are you trying to copy your 7z archived data-dir files to the NAS?

I think using robocopy is the wrong strategy. You can just copy the files using Copy-Item in powershell. It might work better if you map a drive to your NAS share.

That's all the time I have at the moment, but you can experiment by copying and using the "Backup Miscellaneous Files" section from "HMailserverBackup.ps1". If you can't work it out, I'll help you when I get back next week.

Many thanks will check the log zipping.

Are you trying to copy your 7z archived data-dir files to the NAS? <---- YES

I am not mapping the NAS drive to the Server since If Ransomeware comes it affects all drives attached in the system, Any Suggestion if NOT TO USE ROBOCOPY.


Happy Holidays

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-08 14:33

Looks like you can use copy-item with unc paths.

https://duckduckgo.com/?q=powershell+co ... work+share

I never tried it. But then, i never tried anything i never did before i did them. :D

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2021-01-08 15:52

palinka wrote:
2021-01-08 14:33
Looks like you can use copy-item with unc paths.

https://duckduckgo.com/?q=powershell+co ... work+share

I never tried it. But then, i never tried anything i never did before i did them. :D
If RansomeWare is an issue then you cannot be authenticated on the target server permanently as this is a free pass to the file structure.

If you are using UNC then you need to LOG ON the server, copy data, LOG OFF the server. Any permanent authentication with the server will open up the file structure.

OR use SFTP 8)

https://www.powershellmagazine.com/2014 ... ll-module/
https://github.com/darkoperator/Posh-SSH
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-09 06:43

Thank you Palinka and Soren for pointers.

Here is what I found. For Uploading to NAS by NOT USING ROBOCOPY

https://github.com/marcosfreccia/Powers ... System.ps1

Code: Select all

$SourceFolder = "D:\Source"
$TargetFolder = "D:\Target\"

$SourceFolderItems = Get-ChildItem -Recurse -Path D:\Source 
$TargetFolderItems = Get-ChildItem  -Recurse -Path D:\Target 


try {
    
    $Result = Compare-Object -ReferenceObject $SourceFolderItems -DifferenceObject $TargetFolderItems 


    # Symbol == it means that it exists in both sides
    # Symbol <= it means that it exists in the SourceFolder but not in the TargetFolder
    # Symbol => it means that it exists in the Target but not in the Source

    foreach ($folder in $Result) {
        if ($folder.SideIndicator -eq "<=") {
            $FullSourceObject = $folder.InputObject.FullName
            $FullTargetObject = $folder.InputObject.FullName.Replace($SourceFolder, $TargetFolder)

            Write-Host "Attempt to copy the following: " $FullSourceObject
            Copy-Item -Path $FullSourceObject -Destination $FullTargetObject
        }
    }
}
catch {
    Write-Error -Message "Something bad happened!" -ErrorAction Stop
}
http://woshub.com/copying-large-files-u ... owershell/

Code: Select all


Import-Module BitsTransfer
$Source="\\lond-rep01\share\"
$Destination="c:\tmp\"
if ( -Not (Test-Path $Destination))
{
$null = New-Item -Path $Destination -ItemType Directory
}
$folders = Get-ChildItem -Name -Path $source -Directory -Recurse
$bitsjob = Start-BitsTransfer -Source $Source\*.* -Destination $Destination -asynchronous -Priority low
while( ($bitsjob.JobState.ToString() -eq 'Transferring') -or ($bitsjob.JobState.ToString() -eq 'Connecting') )
{
Sleep 4
}
Complete-BitsTransfer -BitsJob $bitsjob
foreach ($i in $folders)
{
$exists = Test-Path $Destination\$i
if ($exists -eq $false) {New-Item $Destination\$i -ItemType Directory}
$bitsjob = Start-BitsTransfer -Source $Source\$i\*.* -Destination $Destination\$i -asynchronous -Priority low
while( ($bitsjob.JobState.ToString() -eq 'Transferring') -or ($bitsjob.JobState.ToString() -eq 'Connecting') )
{
Sleep 4
}
Complete-BitsTransfer -BitsJob $bitsjob
}


What should be best Approach?

Soren This is Exactly I want to Do

need to LOG ON the server, copy data, LOG OFF the server But also want to achive Mirror like in Robocopy so I dont have to manually delete old backups from the NAS when deleted from local drive. :P

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2021-01-09 13:13

gotspatel wrote:
2021-01-09 06:43
Thank you Palinka and Soren for pointers.

Here is what I found. For Uploading to NAS by NOT USING ROBOCOPY

https://github.com/marcosfreccia/Powers ... System.ps1

Code: Select all

$SourceFolder = "D:\Source"
$TargetFolder = "D:\Target\"

$SourceFolderItems = Get-ChildItem -Recurse -Path D:\Source 
$TargetFolderItems = Get-ChildItem  -Recurse -Path D:\Target 


try {
    
    $Result = Compare-Object -ReferenceObject $SourceFolderItems -DifferenceObject $TargetFolderItems 


    # Symbol == it means that it exists in both sides
    # Symbol <= it means that it exists in the SourceFolder but not in the TargetFolder
    # Symbol => it means that it exists in the Target but not in the Source

    foreach ($folder in $Result) {
        if ($folder.SideIndicator -eq "<=") {
            $FullSourceObject = $folder.InputObject.FullName
            $FullTargetObject = $folder.InputObject.FullName.Replace($SourceFolder, $TargetFolder)

            Write-Host "Attempt to copy the following: " $FullSourceObject
            Copy-Item -Path $FullSourceObject -Destination $FullTargetObject
        }
    }
}
catch {
    Write-Error -Message "Something bad happened!" -ErrorAction Stop
}
http://woshub.com/copying-large-files-u ... owershell/

Code: Select all


Import-Module BitsTransfer
$Source="\\lond-rep01\share\"
$Destination="c:\tmp\"
if ( -Not (Test-Path $Destination))
{
$null = New-Item -Path $Destination -ItemType Directory
}
$folders = Get-ChildItem -Name -Path $source -Directory -Recurse
$bitsjob = Start-BitsTransfer -Source $Source\*.* -Destination $Destination -asynchronous -Priority low
while( ($bitsjob.JobState.ToString() -eq 'Transferring') -or ($bitsjob.JobState.ToString() -eq 'Connecting') )
{
Sleep 4
}
Complete-BitsTransfer -BitsJob $bitsjob
foreach ($i in $folders)
{
$exists = Test-Path $Destination\$i
if ($exists -eq $false) {New-Item $Destination\$i -ItemType Directory}
$bitsjob = Start-BitsTransfer -Source $Source\$i\*.* -Destination $Destination\$i -asynchronous -Priority low
while( ($bitsjob.JobState.ToString() -eq 'Transferring') -or ($bitsjob.JobState.ToString() -eq 'Connecting') )
{
Sleep 4
}
Complete-BitsTransfer -BitsJob $bitsjob
}


What should be best Approach?

Soren This is Exactly I want to Do

need to LOG ON the server, copy data, LOG OFF the server But also want to achive Mirror like in Robocopy so I dont have to manually delete old backups from the NAS when deleted from local drive. :P
When I do my weekly "backup-backup" (backing up the built-in hMailServer backups) I use Remote Desktop to my server, log on network resources, sync network drives with DSynchronize v2.30.6 (server is a W2K3R2 Server), log off servers, disconnect Remote Desktop.
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-09 13:26

SorenR wrote:
2021-01-09 13:13


When I do my weekly "backup-backup" (backing up the built-in hMailServer backups) I use Remote Desktop to my server, log on network resources, sync network drives with DSynchronize v2.30.6 (server is a W2K3R2 Server), log off servers, disconnect Remote Desktop.
:lol: As simple as That. But I want to Automize the process so I don't have to do that manually.

User avatar
jimimaseye
Moderator
Moderator
Posts: 10060
Joined: 2011-09-08 17:48

Re: hMailServer Offsite Backup

Post by jimimaseye » 2021-01-09 13:54

Winscp can do a synchronize backup (using sftp). It can reference destination by ftp or by unc as per your choice) but using sftp protocol can you can look down to single port and connection authentication therefore secure against unwanted connections and devices. It can also de incorporated in scripts (using the .com version) - useful for automation.

I used this method.

[Entered by mobile. Excuse my spelling.]
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-10 06:31

jimimaseye wrote:
2021-01-09 13:54
Winscp can do a synchronize backup (using sftp). It can reference destination by ftp or by unc as per your choice) but using sftp protocol can you can look down to single port and connection authentication therefore secure against unwanted connections and devices. It can also de incorporated in scripts (using the .com version) - useful for automation.

I used this method.

[Entered by mobile. Excuse my spelling.]
Thanks will check that out

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-10 22:40

jimimaseye wrote:
2021-01-09 13:54
Winscp can do a synchronize backup (using sftp). It can reference destination by ftp or by unc as per your choice) but using sftp protocol can you can look down to single port and connection authentication therefore secure against unwanted connections and devices. It can also de incorporated in scripts (using the .com version) - useful for automation.

I used this method.

[Entered by mobile. Excuse my spelling.]
^^ looks good.

Have a look at this: https://stackoverflow.com/questions/387 ... powershell

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-11 15:39

jimimaseye wrote:
2021-01-09 13:54
Winscp can do a synchronize backup (using sftp). It can reference destination by ftp or by unc as per your choice) but using sftp protocol can you can look down to single port and connection authentication therefore secure against unwanted connections and devices. It can also de incorporated in scripts (using the .com version) - useful for automation.

I used this method.

[Entered by mobile. Excuse my spelling.]
Can this command be used SAFELY "keepuptodate" to keep both the local and NAS folder in Sync for deletion also.

User avatar
jimimaseye
Moderator
Moderator
Posts: 10060
Joined: 2011-09-08 17:48

Re: hMailServer Offsite Backup

Post by jimimaseye » 2021-01-11 22:58

gotspatel wrote:
2021-01-11 15:39
Can this command be used SAFELY "keepuptodate" to keep both the local and NAS folder in Sync for deletion also.
I use the SYNC method and found it reliable.

Heres an example:

Code: Select all

C:\Users\Administrator\Documents\BatchFiles\winscp.com /script=Upload.scp >> %Backlog%
where Upload.scp:

Code: Select all

option batch continue >> Upload.scp
option confirm off >> Upload.scp
option reconnecttime 3600 >> Upload.scp
option transfer binary >> Upload.scp
open loginuser@backupdestination.com >> Upload.scp
synchronize remote -criteria=time -delete -speed=95 "D:\Backuptemp\" "/CompanySafeBackup/Backuptemp" >> Upload.scp
synchronize remote -criteria=time -delete -speed=95 "D:\INSTALLATIONS\" "/CompanySafeBackup/INSTALLATIONS" >> Upload.scp
synchronize remote -criteria=time -delete -speed=95 "C:\Users\Administrator\Documents\" "/CompanySafeBackup/AdministratorDocuments" >> Upload.scp
synchronize remote -criteria=time -delete -speed=95 "D:\Misc Data\" "/CompanyMisc/Misc Data" >> Upload.scp
synchronize remote -criteria=time -delete -speed=95 "D:\Company3PC_BackupStore\" "/CompanyMisc/Company3PC_BackupStore" >> Upload.scp
exit >> Upload.scp
Completely unattended (appended as part of my https://www.hmailserver.com/forum/viewt ... 21&t=28139 script)
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-12 08:51

palinka wrote:
2021-01-08 14:10
gotspatel wrote:
2021-01-08 12:27
Please ignore my Ignorance but I am no programmer but learning from the forum. :D
That was me not long ago. :D

Sorry, but you caught me at a bad time. I have to go away for the weekend with no computer, so I won't be able to get to much until Monday, but I have a couple of minutes now, so... :D

For the log cycling, just leave everything as is. Fill out the variables in the config and let it do its thing. It should just work. As to zipping the log files, try copying the 7z function and adding it to hMailServerBackup.ps1 below the section for cycling logs. Then just set the location you want to store the zipped log files. There's no need for password protection here, I think, so I stripped that out. Its much faster without it.
Implemented the code but getting error in using 7zip for logs, calling the 7zip, I checked your code in hMailServerBackupFunctions.ps1 also it is the same, still it is throwing this error here for logs of PATH. but it is successfully creating zip for the main backup of mails and other data.

PS: $SevenZipInSystemPath = $False // I have not set it to system path.

Code: Select all

PS C:\Users\NSP.Admin> C:\Scripts\HMSBackup\hMailServerBackup.ps1


    Directory: C:\Scripts\HMSBackup


Mode                LastWriteTime         Length Name                                                                                                                            
----                -------------         ------ ----                                                                                                                            
-a----       12/01/2021  12:07 PM              0 EmailBody.log                                                                                                                   


    Directory: C:\HMS-BACKUP


Mode                LastWriteTime         Length Name                                                                                                                            
----                -------------         ------ ----                                                                                                                            
-a----       12/01/2021  12:07 PM              0 hMailServerDebug-2021-01-12.log                                                                                                 
12/01/2021 12:07 PM : Last Reboot Time          : 2021-01-07 19:50:00
12/01/2021 12:07 PM : HMS Start Time            : 2021-01-12 12:05:40
12/01/2021 12:07 PM : HMS Daily Spam Reject     : 0
12/01/2021 12:07 PM : HMS Daily Viruses Removed : 0
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Stop hMailServer
12/01/2021 12:07 PM : hMailServer running. Preparing to stop service.
12/01/2021 12:07 PM : hMailServer shutting down.
12/01/2021 12:07 PM : hMailServer successfully stopped in 1 second
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Start backing up datadir with RoboCopy
12/01/2021 12:07 PM : 
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : 12 January 2021 12:07 PM
   Source : C:\Program Files (x86)\hMailServer\Data\
     Dest : C:\HMS-Backup-TEMP\hMailData\

    Files : *.*
	    
  Options : *.* /NDL /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /R:43200 /W:1 

------------------------------------------------------------------------------

	  *EXTRA File 		   30181	C:\HMS-Backup-TEMP\hMailData\EventHandlers.vbs
	  *EXTRA File 		    2127	C:\HMS-Backup-TEMP\hMailData\hMailServer.INI
	  *EXTRA File 		   2.4 m	C:\HMS-Backup-TEMP\hMailData\MYSQLDump_2021-01-12.sql
	    New File  		    9635	C:\Program Files (x86)\hMailServer\Data\metrometaliks.com\mirror\DE\{DE78223B-9E3C-45C1-991C-EA008068A394}.eml

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :      2238         0      2238         0         0         0
   Files :      3430         1      3429         0         0         3
   Bytes : 1005.29 m     9.4 k 1005.28 m         0         0    2.44 m
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
   Ended : 12 January 2021 12:07 PM


12/01/2021 12:07 PM : Finished backing up data dir in less than 1 second
12/01/2021 12:07 PM : Robocopy backup success: 1 new, 3 deleted, 0 mismatched, 0 failed
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Begin backing up MySQL
mysqldump.exe : mysqldump: [Warning] Using a password on the command line interface can be insecure.
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:207 char:4
+             & $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (mysqldump: [War...an be insecure.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
12/01/2021 12:07 PM : MySQL successfully dumped in less than 1 second
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Begin backing up miscellaneous files
12/01/2021 12:07 PM : hMailServer.INI successfully backed up
12/01/2021 12:07 PM : EventHandlers.vbs successfully backed up
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Archiving Log Files
cmd.exe : 'C:\Program' is not recognized as an internal or external command,
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:269 char:15
+ ... $SevenZip = & cmd /c $SevenZipExe a -t7z -mx=9 -ms=on "$LogBackupLoca ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ('C:\Program' is...ternal command,:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
operable program or batch file.
12/01/2021 12:07 PM : 
12/01/2021 12:07 PM : Logs Backup Archive creation finished in less than 1 second
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Start hMailServer
12/01/2021 12:07 PM : hMailServer not running. Preparing to start service.
12/01/2021 12:07 PM : hMailServer starting up
12/01/2021 12:07 PM : hMailServer successfully started in less than 1 second
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : hMailServer was out of service for 3 seconds
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Begin pruning messages older than 30 days
12/01/2021 12:07 PM : No messages older than 30 days to prune
12/01/2021 12:07 PM : No empty subfolders deleted
12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Create archive : 2021-01-12-hMailServer
12/01/2021 12:07 PM : Archive folder : C:\HMS-Backup-TEMP
Here is the code, I tweaked it a little bit

Code: Select all

<#  Zip log files  #>
$StartLogFileArchive = Get-Date
Debug "----------------------------"
Debug "Archiving Log Files"
$SevenZipExe = "$SevenZipDir\7z.exe"
$LogBackupLocation 	   = "C:\HMS-Log-Archive"	
$LogFileBackupName = "hMSLogs-$((Get-Date).ToString('yyyy-MM-dd'))"
Try {
	If ($SevenZipInSystemPath) {
		$SevenZip = & cmd /c 7z a -t7z -mx=9 -ms=on "$LogBackupLocation\$LogFileBackupName.7z" "$hMSDir\Logs\*" | Out-String
	} Else {
		$SevenZip = & cmd /c $SevenZipExe a -t7z -mx=9 -ms=on "$LogBackupLocation\$LogFileBackupName.7z" "$hMSDir\Logs\*" | Out-String
	}
	Debug $SevenZip
	Debug "Logs Backup Archive creation finished in $(ElapsedTime $StartLogFileArchive)"
	Email "[OK] Logs archive created"
}
Catch {
	Debug "[ERROR] Logs Archive Creation : $($Error[0])"
	Email "[ERROR] Logs Archive Creation : Check Debug Log"
	Email "[ERROR] Logs Archive Creation : $($Error[0])"
	EmailResults
	Exit
}


gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-12 10:34

One more error in Bayes processing

Code: Select all

cmd.exe : Access is denied.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:729 char:5
+ ...             & cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBack ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Access is denied.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-12 13:25

gotspatel wrote:
2021-01-12 08:51
Implemented the code but getting error in using 7zip for logs, calling the 7zip, I checked your code in hMailServerBackupFunctions.ps1 also it is the same, still it is throwing this error here for logs of PATH. but it is successfully creating zip for the main backup of mails and other data.

PS: $SevenZipInSystemPath = $False // I have not set it to system path.

Code: Select all

12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Archiving Log Files
cmd.exe : 'C:\Program' is not recognized as an internal or external command,
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:269 char:15
+ ... $SevenZip = & cmd /c $SevenZipExe a -t7z -mx=9 -ms=on "$LogBackupLoca ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ('C:\Program' is...ternal command,:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
operable program or batch file.
* Make sure the path in the config is correct
* Make sure the path in the config is wrapped in quotes
* If that doesn't work, try putting quotes around $SevenZipExe

This error is when there are spaces in the path. Wrapping the path in quotes usually resolves it.

Code: Select all

$SevenZipDir           = "C:\Program Files\7-Zip"  # Path to 7-Zip Install Directory

Code: Select all

		$SevenZip = & cmd /c "$SevenZipExe" a -t7z -mx=9 -ms=on "$LogBackupLocation\$LogFileBackupName.7z" "$hMSDir\Logs\*" | Out-String
I tested the original code (not system path, no quotes) and it worked on my system.

Also, this is interesting. I don't get this warning. I'll look into that. Looks like it dumped successfully anyway.

Code: Select all

12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Begin backing up MySQL
mysqldump.exe : mysqldump: [Warning] Using a password on the command line interface can be insecure.
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:207 char:4
+             & $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (mysqldump: [War...an be insecure.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
12/01/2021 12:07 PM : MySQL successfully dumped in less than 1 second

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-12 13:27

gotspatel wrote:
2021-01-12 10:34
One more error in Bayes processing

Code: Select all

cmd.exe : Access is denied.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:729 char:5
+ ...             & cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBack ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Access is denied.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
Are you running powershell in administrator console?

User avatar
jimimaseye
Moderator
Moderator
Posts: 10060
Joined: 2011-09-08 17:48

Re: hMailServer Offsite Backup

Post by jimimaseye » 2021-01-12 13:29

Here's a tip:

There is a 7zip executable already provided by Hmailserver:

C:\Program Files (x86)\hMailServer\Bin\7za.exe

Why not use that and do away with separate 7zip install and path?
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-12 13:47

palinka wrote:
2021-01-12 13:25
gotspatel wrote:
2021-01-12 08:51
Implemented the code but getting error in using 7zip for logs, calling the 7zip, I checked your code in hMailServerBackupFunctions.ps1 also it is the same, still it is throwing this error here for logs of PATH. but it is successfully creating zip for the main backup of mails and other data.

PS: $SevenZipInSystemPath = $False // I have not set it to system path.

Code: Select all

12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Archiving Log Files
cmd.exe : 'C:\Program' is not recognized as an internal or external command,
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:269 char:15
+ ... $SevenZip = & cmd /c $SevenZipExe a -t7z -mx=9 -ms=on "$LogBackupLoca ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ('C:\Program' is...ternal command,:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
operable program or batch file.
* Make sure the path in the config is correct
* Make sure the path in the config is wrapped in quotes
* If that doesn't work, try putting quotes around $SevenZipExe

This error is when there are spaces in the path. Wrapping the path in quotes usually resolves it.

Code: Select all

$SevenZipDir           = "C:\Program Files\7-Zip"  # Path to 7-Zip Install Directory

Code: Select all

		$SevenZip = & cmd /c "$SevenZipExe" a -t7z -mx=9 -ms=on "$LogBackupLocation\$LogFileBackupName.7z" "$hMSDir\Logs\*" | Out-String
I tested the original code (not system path, no quotes) and it worked on my system.

Also, this is interesting. I don't get this warning. I'll look into that. Looks like it dumped successfully anyway.

Code: Select all

12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Begin backing up MySQL
mysqldump.exe : mysqldump: [Warning] Using a password on the command line interface can be insecure.
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:207 char:4
+             & $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (mysqldump: [War...an be insecure.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
12/01/2021 12:07 PM : MySQL successfully dumped in less than 1 second
* Make sure the path in the config is correct - PATH is CORRECT, Since the Mail Data is getting zipped with same parameters.

* Make sure the path in the config is wrapped in quotes - It is in Quotes $SevenZipDir = "C:\Program Files\7-Zip"

* If that doesn't work, try putting quotes around $SevenZipExe - Tried that but doesn't help.

Code: Select all



    Directory: C:\Scripts\HMSBackup


Mode                LastWriteTime         Length Name                                                                                                        
----                -------------         ------ ----                                                                                                        
-a----       12/01/2021  05:06 PM              0 EmailBody.log                                                                                               


    Directory: C:\HMS-BACKUP


Mode                LastWriteTime         Length Name                                                                                                        
----                -------------         ------ ----                                                                                                        
-a----       12/01/2021  05:06 PM              0 hMailServerDebug-2021-01-12.log                                                                             
12/01/2021 05:06 PM : Last Reboot Time          : 2021-01-07 19:50:00
12/01/2021 05:06 PM : HMS Start Time            : 2021-01-12 14:26:31
12/01/2021 05:06 PM : HMS Daily Spam Reject     : 0
12/01/2021 05:06 PM : HMS Daily Viruses Removed : 0
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Stop hMailServer
12/01/2021 05:06 PM : hMailServer running. Preparing to stop service.
12/01/2021 05:06 PM : hMailServer shutting down.
12/01/2021 05:06 PM : hMailServer successfully stopped in 1 second
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Stop spamassassin
12/01/2021 05:06 PM : spamassassin running. Preparing to stop service.
12/01/2021 05:06 PM : spamassassin shutting down.
12/01/2021 05:06 PM : spamassassin successfully stopped in less than 1 second
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Updating SpamAssassin
12/01/2021 05:06 PM : Update finished, no fresh updates were available

12/01/2021 05:06 PM : Finished updating SpamAssassin in 2 seconds
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Start backing up datadir with RoboCopy
12/01/2021 05:06 PM : 
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : 12 January 2021 05:06 PM
   Source : C:\Program Files (x86)\hMailServer\Data\
     Dest : C:\HMS-Backup-TEMP\hMailData\

    Files : *.*
	    
  Options : *.* /NDL /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /R:43200 /W:1 


[b][color=#FF4040]I removed the file coping lines here to shorten the log[/color][/b]
------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :      2251        12      2239         0         0         0
   Files :      3507        70      3437         0         0         8
   Bytes :   1.006 g   24.82 m 1005.56 m         0         0    2.48 m
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00


   Speed :           148752011 Bytes/sec.
   Speed :            8511.658 MegaBytes/min.
   Ended : 12 January 2021 05:06 PM


12/01/2021 05:06 PM : Finished backing up data dir in 1 second
12/01/2021 05:06 PM : Robocopy backup success: 70 new, 8 deleted, 0 mismatched, 0 failed
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Begin backing up MySQL
mysqldump.exe : mysqldump: [Warning] Using a password on the command line interface can be insecure.
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:207 char:4
+             & $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (mysqldump: [War...an be insecure.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
12/01/2021 05:06 PM : MySQL successfully dumped in 1 second
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Begin backing up miscellaneous files
12/01/2021 05:06 PM : hMailServer.INI successfully backed up
12/01/2021 05:06 PM : EventHandlers.vbs successfully backed up
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Archiving Log Files
cmd.exe : 'C:\Program' is not recognized as an internal or external command,
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:310 char:15
+ ... $SevenZip = & cmd /c "$SevenZipExe" a -tzip -mx=9 -ms=on "$LogBackupL ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ('C:\Program' is...ternal command,:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
operable program or batch file.
12/01/2021 05:06 PM : 
12/01/2021 05:06 PM : Logs Backup Archive creation finished in less than 1 second
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Start spamassassin
12/01/2021 05:06 PM : spamassassin not running. Preparing to start service.
12/01/2021 05:06 PM : spamassassin starting up
12/01/2021 05:06 PM : spamassassin successfully started in 1 second
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Start hMailServer
12/01/2021 05:06 PM : hMailServer not running. Preparing to start service.
12/01/2021 05:06 PM : hMailServer starting up
12/01/2021 05:06 PM : hMailServer successfully started in less than 1 second
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : hMailServer was out of service for 9 seconds
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Begin pruning messages older than 30 days
12/01/2021 05:06 PM : No messages older than 30 days to prune
12/01/2021 05:06 PM : No empty subfolders deleted
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Begin learning Bayes tokens from messages newer than 7 days
12/01/2021 05:06 PM : Learned tokens from 0 of 3 HAM messages fed from INBOX in mail1@mydomain.com
12/01/2021 05:06 PM : Learned tokens from 0 of 1 HAM message fed from INBOX in mail2@mydomain.com
12/01/2021 05:06 PM : Learned tokens from 0 of 7 HAM messages fed from INBOX in mail3@mydomain.com
12/01/2021 05:06 PM : Learned tokens from 0 of 1 HAM message fed from INBOX in mail4@mydomain.com
12/01/2021 05:06 PM : Learned tokens from 0 of 1 HAM message fed from INBOX in mail5@mydomain.com
12/01/2021 05:06 PM : Learned tokens from 0 of 2 HAM messages fed from INBOX in mail6@mydomain.com
12/01/2021 05:06 PM : Learned tokens from 0 of 1 HAM message fed from INBOX in mail7@mydomain.com
REMOVED SOME LINES HERE
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Finished feeding 148 messages to Bayes in 15 seconds
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Bayes learned from 0 of 148 HAM messages found
12/01/2021 05:06 PM : No SPAM messages newer than 7 days to feed to Bayes
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : [ERROR] Bayes Journal Sync: Nothing to sync
12/01/2021 05:06 PM : ----------------------------
cmd.exe : Access is denied.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:729 char:5
+ ...             & cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBack ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Access is denied.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
12/01/2021 05:06 PM : [ERROR] backing up Bayes : Unknown Error backing up Bayes database
12/01/2021 05:06 PM : ----------------------------
12/01/2021 05:06 PM : Create archive : 2021-01-12-hMailServer
12/01/2021 05:06 PM : Archive folder : C:\HMS-Backup-TEMP
12/01/2021 05:07 PM : 
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Open archive: C:\HMS-BACKUP\2021-01-12-hMailServer\2021-01-12-hMailServer.zip
--
Path = C:\HMS-BACKUP\2021-01-12-hMailServer\2021-01-12-hMailServer.zip
Type = zip
Physical Size = 699930832

Scanning the drive:
2251 folders, 3510 files, 1083071369 bytes (1033 MiB)

Updating archive: C:\HMS-BACKUP\2021-01-12-hMailServer\2021-01-12-hMailServer.zip

Keep old data in archive: 8 files, 196918 bytes (193 KiB)
Add new data to archive: 2251 folders, 3510 files, 1083071369 bytes (1033 MiB)


Files read from disk: 3510
Archive size: 713390284 bytes (681 MiB)
Everything is Ok

12/01/2021 05:07 PM : Archive creation finished in 1 minute 13 seconds
12/01/2021 05:07 PM : Wait a few seconds to make sure archive is finished
12/01/2021 05:07 PM : ----------------------------
12/01/2021 05:07 PM : Checking for script update at GitHub
12/01/2021 05:08 PM : Backup & Upload script is latest version: 1.13
12/01/2021 05:08 PM : ----------------------------
12/01/2021 05:08 PM : hMailServer Backup and Upload routine completed in 1 minute 48 seconds

Are you running powershell in administrator console? - YES, I ran the code from Administrator login and powershell ISE

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-12 13:48

jimimaseye wrote:
2021-01-12 13:29
Here's a tip:

There is a 7zip executable already provided by Hmailserver:

C:\Program Files (x86)\hMailServer\Bin\7za.exe

Why not use that and do away with separate 7zip install and path?
My understanding is that 7za will not make the encrypted multi-volume archive with file header encryption (highest encryption).

Although I just did some goolaging and that may not be correct. I'll test it later to find out for sure. The documentation is a little unclear, or maybe I haven't had enough coffee yet.

I agree: simpler is better.

User avatar
jimimaseye
Moderator
Moderator
Posts: 10060
Joined: 2011-09-08 17:48

Re: hMailServer Offsite Backup

Post by jimimaseye » 2021-01-12 13:51

Maybe the help text helps:

Code: Select all

C:\Program Files (x86)\hMailServer\Bin>7za

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries

C:\Program Files (x86)\hMailServer\Bin>
(There is a "-v{Size}[b|k|m|g]: Create volumes" option)

Wikipedia says "standalone executable 7za.exe, containing built-in modules, but with compression/decompression support limited to 7z, ZIP, gzip, bzip2, Z and tar formats."

For sure .7z has a higher compression of .Zip but is slower in doing so (naturally).
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-12 14:14

jimimaseye wrote:
2021-01-12 13:51
Maybe the help text helps:

Code: Select all

C:\Program Files (x86)\hMailServer\Bin>7za


C:\Program Files (x86)\hMailServer\Bin>
(There is a "-v{Size}[b|k|m|g]: Create volumes" option)

Wikipedia says "standalone executable 7za.exe, containing built-in modules, but with compression/decompression support limited to 7z, ZIP, gzip, bzip2, Z and tar formats."

For sure .7z has a higher compression of .Zip but is slower in doing so (naturally).
Understood your point.

The problem solved be changing path to 8.3 name $SevenZipDir = "C:\Progra~1\7-Zip"

Even tried the hmail directory 7za.exe and works well only with C:\Progra~2\hMailServer\bin" and NOT "C:\Program Files (x86)\hMailServer\bin" Dontt understand why

I am on Windows Server 2019 Standard

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-12 14:17

palinka wrote:
2021-01-12 13:27
gotspatel wrote:
2021-01-12 10:34
One more error in Bayes processing

Code: Select all

cmd.exe : Access is denied.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:729 char:5
+ ...             & cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBack ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Access is denied.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
Are you running powershell in administrator console?
This problem still stays

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2021-01-12 14:21

gotspatel wrote:
2021-01-12 14:14
jimimaseye wrote:
2021-01-12 13:51
Maybe the help text helps:

Code: Select all

C:\Program Files (x86)\hMailServer\Bin>7za


C:\Program Files (x86)\hMailServer\Bin>
(There is a "-v{Size}[b|k|m|g]: Create volumes" option)

Wikipedia says "standalone executable 7za.exe, containing built-in modules, but with compression/decompression support limited to 7z, ZIP, gzip, bzip2, Z and tar formats."

For sure .7z has a higher compression of .Zip but is slower in doing so (naturally).
Understood your point.

The problem solved be changing path to 8.3 name $SevenZipDir = "C:\Progra~1\7-Zip"

Even tried the hmail directory 7za.exe and works well only with C:\Progra~2\hMailServer\bin" and NOT "C:\Program Files (x86)\hMailServer\bin" Dontt understand why

I am on Windows Server 2019 Standard
Not to worry, it "just one of those things with Windows". The problem with path names containing one or more spaces has existed since Windows 95.

https://www.howtogeek.com/694949/how-to ... mand-line/
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-12 14:32

SorenR wrote:
2021-01-12 14:21

Not to worry, it "just one of those things with Windows". The problem with path names containing one or more spaces has existed since Windows 95.

https://www.howtogeek.com/694949/how-to ... mand-line/
Thanks for the pointer, if it is not a problem I need not worry. I will move on to other area now. :D

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-12 14:39

jimimaseye wrote:
2021-01-12 13:51
Maybe the help text helps:

Code: Select all

C:\Program Files (x86)\hMailServer\Bin>7za

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries

C:\Program Files (x86)\hMailServer\Bin>
(There is a "-v{Size}[b|k|m|g]: Create volumes" option)

Wikipedia says "standalone executable 7za.exe, containing built-in modules, but with compression/decompression support limited to 7z, ZIP, gzip, bzip2, Z and tar formats."

For sure .7z has a higher compression of .Zip but is slower in doing so (naturally).
I got the command syntax from here: https://askubuntu.com/questions/928275/ ... mes#928301

Indeed it does look like it should work. Will test later when i have time.

User avatar
SorenR
Senior user
Senior user
Posts: 6315
Joined: 2006-08-21 15:38
Location: Denmark

Re: hMailServer Offsite Backup

Post by SorenR » 2021-01-12 17:38

gotspatel wrote:
2021-01-12 14:32
SorenR wrote:
2021-01-12 14:21

Not to worry, it "just one of those things with Windows". The problem with path names containing one or more spaces has existed since Windows 95.

https://www.howtogeek.com/694949/how-to ... mand-line/
Thanks for the pointer, if it is not a problem I need not worry. I will move on to other area now. :D
Maybe not everyone will read the link so just for clarification:
PowerShell uses the grave accent ( ` ) character as its escape character. Just add it before each space in the file name. (You’ll find this character above the Tab key and below the Esc key on your keyboard.)

Code: Select all

type C:\Test` Folder\Test` File.txt
Each grave accent character tells PowerShell to escape the following character.

Note that this only works in the PowerShell environment. You’ll have to use the caret character in Command Prompt.
The grave accent is actually to the left of the backspace key on my Danish keyboard so look for it yourself ;-)
SørenR.

Woke is Marxism advancing through Maoist cultural revolution.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-13 00:02

SorenR wrote:
2021-01-12 17:38
Maybe not everyone will read the link so just for clarification:
PowerShell uses the grave accent ( ` ) character as its escape character. Just add it before each space in the file name. (You’ll find this character above the Tab key and below the Esc key on your keyboard.)

Code: Select all

type C:\Test` Folder\Test` File.txt
Each grave accent character tells PowerShell to escape the following character.

Note that this only works in the PowerShell environment. You’ll have to use the caret character in Command Prompt.
The grave accent is actually to the left of the backspace key on my Danish keyboard so look for it yourself ;-)
I did not know that (about escaping the space). Usually, I just enclose in quotes with the grave accent (if the powershell line is already in quotes):

Code: Select all

`"C:\Program Files\path\to\whatever`"
I think it should be tested in the cmd window as well, because all powershell is doing is passing the command and escaping the space won't work if the command does not allow spaces to begin with.

CMD:
C:\Program Files\path\to\whatever
vs
"C:\Program Files\path\to\whatever"

The first won't work even if you escape the space in powershell (I think :D ). But putting the path in quotes should work.

Example:

Code: Select all

& cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBackupLocation`""
^^ In my config in this script, $SADir is the default Spamassassin location, which is C:\Program Files\Jam... so there is definitely a space in the path.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-13 01:38

jimimaseye wrote:
2021-01-12 13:51
Maybe the help text helps:

Code: Select all

C:\Program Files (x86)\hMailServer\Bin>7za

7-Zip (A) 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries

C:\Program Files (x86)\hMailServer\Bin>
(There is a "-v{Size}[b|k|m|g]: Create volumes" option)

Wikipedia says "standalone executable 7za.exe, containing built-in modules, but with compression/decompression support limited to 7z, ZIP, gzip, bzip2, Z and tar formats."

For sure .7z has a higher compression of .Zip but is slower in doing so (naturally).
I'll be damned. It does work. No changes in code except for exe location. 👍

Will change tonight.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-13 16:20

palinka wrote:
2021-01-13 01:38
jimimaseye wrote:
2021-01-12 13:51
Maybe the help text helps:

Code: Select all

C:\Program Files (x86)\hMailServer\Bin>7za
[/quote]

I'll be damned. It does work. No changes in code except for exe location. 👍

Will change tonight.
[/quote]

Done.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-13 16:33

gotspatel wrote:
2021-01-12 13:47
palinka wrote:
2021-01-12 13:25
Also, this is interesting. I don't get this warning. I'll look into that. Looks like it dumped successfully anyway.

Code: Select all

12/01/2021 12:07 PM : ----------------------------
12/01/2021 12:07 PM : Begin backing up MySQL
mysqldump.exe : mysqldump: [Warning] Using a password on the command line interface can be insecure.
At C:\Scripts\HMSBackup\hMailServerBackup.ps1:207 char:4
+             & $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (mysqldump: [War...an be insecure.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
12/01/2021 12:07 PM : MySQL successfully dumped in less than 1 second
If you want to suppress this warning, try adding -WarningAction SilentlyContinue to the mysqldump command:

Code: Select all

	Try {
		If ($BackupAllMySQLDatbase) {
			& $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases --result-file=$MySQLDumpFile -WarningAction SilentlyContinue
		} Else {
			& $MySQLDump -u $MySQLUser $MySQLDumpPass $MySQLDatabase --result-file=$MySQLDumpFile -WarningAction SilentlyContinue
		}
		$BackupSuccess++
		Debug "MySQL successfully dumped in $(ElapsedTime $BeginDBBackup)"
	}
I'm unable to replicate this warning, so you'll have to let me know if it works or not. It may fail by adding a parameter that mysqldump can't understand. Alternatively, you could try piping the warning:

Code: Select all

	Try {
		If ($BackupAllMySQLDatbase) {
			& $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases --result-file=$MySQLDumpFile | Out-Null -WarningAction SilentlyContinue
		} Else {
			& $MySQLDump -u $MySQLUser $MySQLDumpPass $MySQLDatabase --result-file=$MySQLDumpFile | Out-Null -WarningAction SilentlyContinue
		}
		$BackupSuccess++
		Debug "MySQL successfully dumped in $(ElapsedTime $BeginDBBackup)"
	}
Or, simply pipe to null:

Code: Select all

	Try {
		If ($BackupAllMySQLDatbase) {
			& $MySQLDump -u $MySQLUser $MySQLDumpPass --all-databases --result-file=$MySQLDumpFile | Out-Null
		} Else {
			& $MySQLDump -u $MySQLUser $MySQLDumpPass $MySQLDatabase --result-file=$MySQLDumpFile | Out-Null
		}
		$BackupSuccess++
		Debug "MySQL successfully dumped in $(ElapsedTime $BeginDBBackup)"
	}
Or, instead of Out-Null, use Out-String.

One of them is bound to work. You'll have to test it out and let me know which one works.

Out of curiosity, what database and what version are you using?

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-13 17:00

palinka wrote:
2021-01-13 16:33


Or, instead of Out-Null, use Out-String.

One of them is bound to work. You'll have to test it out and let me know which one works.

Out of curiosity, what database and what version are you using?
Tried all variations but the error stays, BUT the SQL dump is coming successfully. I checked over the web also it is just a warning and asks for making another file filename.cnf to pass this parameters. IT is OK I can ignore it.

Can you help in solving the error for spamassassin. I am using default storage of Bayes (Flat Files)

Code: Select all

13/01/2021 08:24 PM : [ERROR] Bayes Journal Sync: Nothing to sync
13/01/2021 08:24 PM : ----------------------------
cmd.exe : Access is denied.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:729 char:5
+ ...             & cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBack ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Access is denied.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
13/01/2021 08:24 PM : [ERROR] backing up Bayes : Unknown Error backing up Bayes database
13/01/2021 08:24 PM : ----------------------------
I am using hmailserver 5.6.8.B2534.28 from RVHD, MYSQL DB Server Community Edition Ver 8.0.22 on Windows Server 209 STD

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-13 18:22

gotspatel wrote:
2021-01-13 17:00
palinka wrote:
2021-01-13 16:33


Or, instead of Out-Null, use Out-String.

One of them is bound to work. You'll have to test it out and let me know which one works.

Out of curiosity, what database and what version are you using?
Tried all variations but the error stays, BUT the SQL dump is coming successfully. I checked over the web also it is just a warning and asks for making another file filename.cnf to pass this parameters. IT is OK I can ignore it.

Can you help in solving the error for spamassassin. I am using default storage of Bayes (Flat Files)

Code: Select all

13/01/2021 08:24 PM : [ERROR] Bayes Journal Sync: Nothing to sync
13/01/2021 08:24 PM : ----------------------------
cmd.exe : Access is denied.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:729 char:5
+ ...             & cmd /c "`"$SADir\sa-learn.exe`" --backup > `"$BayesBack ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Access is denied.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
13/01/2021 08:24 PM : [ERROR] backing up Bayes : Unknown Error backing up Bayes database
13/01/2021 08:24 PM : ----------------------------
I am using hmailserver 5.6.8.B2534.28 from RVHD, MYSQL DB Server Community Edition Ver 8.0.22 on Windows Server 209 STD
The error is access denied, so it probably has something to do with what user is attempting to access sa-learn (unlikely) -or- what user is attempting to access your bayes backup file -or- your bayes backup file does not exist. Check your config file and verify the bayes backup FILE (the config says !FILE!, not folder).

The bayes backup file is tested by test-path, but if you put a valid folder instead of the actual backup file, it will still return true.

What is in your config for $BayesBackupLocation ?

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-14 05:04

palinka wrote:
2021-01-13 18:22


The error is access denied, so it probably has something to do with what user is attempting to access sa-learn (unlikely) -or- what user is attempting to access your bayes backup file -or- your bayes backup file does not exist. Check your config file and verify the bayes backup FILE (the config says !FILE!, not folder).

The bayes backup file is tested by test-path, but if you put a valid folder instead of the actual backup file, it will still return true.

What is in your config for $BayesBackupLocation ?
$BayesBackupLocation= "C:\bayes_backup" :oops:

What should be the FILE name for the Backup I don't know. Guide please. ::Edit:: Tried putting file name "C:\bayes_backup\Bayes.bak" but it doesn't like it. maybe needs a specific name.

Also trying to change from flat file DB of Bayes to MYSQL DB but Failing, please point me to right direction to look for.

Tried Following this guide https://www.hmailserver.com/forum/viewt ... 21&t=31193 but lost myself as spamassassin unable to connect to the db. No Experience in Spamassassin, so just going with defaults and trying to put it to good use by learning from forum

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-14 13:55

gotspatel wrote:
2021-01-14 05:04
$BayesBackupLocation= "C:\bayes_backup" :oops:

What should be the FILE name for the Backup I don't know. Guide please. ::Edit:: Tried putting file name "C:\bayes_backup\Bayes.bak" but it doesn't like it. maybe needs a specific name.

Also trying to change from flat file DB of Bayes to MYSQL DB but Failing, please point me to right direction to look for.

Tried Following this guide https://www.hmailserver.com/forum/viewt ... 21&t=31193 but lost myself as spamassassin unable to connect to the db. No Experience in Spamassassin, so just going with defaults and trying to put it to good use by learning from forum
The default location is C:\Users\Username\.spamassassin\bayes_backup where bayes_backup is the backup FILE.

You can change the location by copying the contents of \.spamassassin\ to wherever you want and then adding the following to spamassassin config (local.cf):

bayes_path C:\path\to\bayes

^^^ \bayes is NOT the folder - it is the prepended name for bayes db files. \to\ (in the example above) is the folder name.

bayes_backup
bayes_journal
bayes_seen
bayes_toks

As long as we're on the subject, I'm going to guess you haven't set up spamassassin to use bayes at all. Here's what I have in local.cf:

Code: Select all

###   Bayes   ###
use_bayes 1
# bayes_auto_learn 0
bayes_path X:\sa-learn\bayes\bayes
# bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status
Autolearn is off because you're manually training, right? Thats the point of "feedbayes" in the backup script. :D

Actually, now that I look at it, I better check to see that autolearn is actually off on my system. I think the default is 1, but I'm going to double check.

Also, I better fix this too:
The bayes backup file is tested by test-path, but if you put a valid folder instead of the actual backup file, it will still return true.
Easy enough to test-path to make sure its a file and not a folder. I'll fix that tonight.

palinka
Senior user
Senior user
Posts: 4461
Joined: 2017-09-12 17:57

Re: hMailServer Offsite Backup

Post by palinka » 2021-01-14 13:58

Also, this thread: Spamassassin bootcamp https://hmailserver.com/forum/viewtopic ... 6&start=60

Read it like its scripture. :mrgreen:

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-14 14:37

palinka wrote:
2021-01-14 13:58
Also, this thread: Spamassassin bootcamp https://hmailserver.com/forum/viewtopic ... 6&start=60

Read it like its scripture. :mrgreen:
Thanks for the head start will check.

And thanks for the config details in previous post, will check and start config.

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-25 06:51

palinka wrote:
2021-01-14 13:58
Also, this thread: Spamassassin bootcamp https://hmailserver.com/forum/viewtopic ... 6&start=60

Read it like its scripture. :mrgreen:
Thanks for this. Recently I started uploading system of backup but getting problem,

1. Neither folder is being created
2. Neither the 7z is being created, Previously it was non password zip files being created when not uploading to letsupload.io
3. Nor it is being uploaded to letsupload, the folder is being created but no file in it as no file in c:\hms-backup


Here is the log, any help please

Code: Select all

25/01/2021 10:14 AM : Create archive : 2021-01-25-hMailServer
25/01/2021 10:14 AM : Archive folder : C:\HMS-Backup-TEMP
cmd.exe : The system cannot find the path specified.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:192 char:16
+ ... $SevenZip = & cmd /c $SevenZipExe a $VolumeSwitch -t7z -m0=lzma2 -mx= ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (The system cann...path specified.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
25/01/2021 10:14 AM : 
25/01/2021 10:14 AM : Archive creation finished in less than 1 second
25/01/2021 10:14 AM : Wait a few seconds to make sure archive is finished
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : Begin offsite upload process
25/01/2021 10:14 AM : Getting access token from LetsUpload
25/01/2021 10:14 AM : Access Token : I REMOVED THE TOCKEN
25/01/2021 10:14 AM : Account ID   : 65239
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : Creating Folder 2021-01-25-hMailServer at LetsUpload
25/01/2021 10:14 AM : Response   : Folder successfully created.
25/01/2021 10:14 AM : Folder ID  : 102338
25/01/2021 10:14 AM : Folder URL : https://letsupload.io/folder//2021-01-25-hMailServer
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : Begin uploading files to LetsUpload
Get-ChildItem : Cannot find path 'C:\HMS-BACKUP\2021-01-25-hMailServer' because it does not exist.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:808 char:19
+ ...   $CountArchVol = (Get-ChildItem "$BackupLocation\$BackupName").Count
+                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\HMS-BACKUP\2021-01-25-hMailServer:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
 
25/01/2021 10:14 AM : There are 0 files to upload
Get-ChildItem : Cannot find path 'C:\HMS-BACKUP\2021-01-25-hMailServer' because it does not exist.
At C:\Scripts\HMSBackup\hMailServerBackupFunctions.ps1:813 char:2
+     Get-ChildItem "$BackupLocation\$BackupName" | ForEach {
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\HMS-BACKUP\2021-01-25-hMailServer:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
 
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : Counting uploaded files at LetsUpload
25/01/2021 10:14 AM : There are 0 files in the remote folder
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : Finished uploading 0 files in 1 second
25/01/2021 10:14 AM : Upload sucessful. 0 files uploaded to https://letsupload.io/folder//2021-01-25-hMailServer
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : Checking for script update at GitHub
25/01/2021 10:14 AM : Backup & Upload script is latest version: 1.14
25/01/2021 10:14 AM : ----------------------------
25/01/2021 10:14 AM : hMailServer Backup and Upload routine completed in 3 minutes 48 seconds


gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-25 08:36

I again tried many different setting combination and conclude as below,

using the $PWProtectedArchive = $True created the problem of not creating the archive locally and not uploading it

If It is false then archives are created locally as well as are uploaded properly.

this is the parameters in hmsbackupconfig.ps1

Code: Select all

<###   7-ZIP VARIABLES   ###>
$UseSevenZip           = $True                  # True will compress backup files into archive
$PWProtectedArchive    = $True                  # False = no-password zip archive, True = AES-256 encrypted multi-volume 7z archive
$SevenZipInSystemPath  = $True                 # If false, will call full path to executable - seems to run faster when called from the system path
$VolumeSize            = "200m"                 # Size of archive volume parts - maximum 200m recommended - valid suffixes for size units are (b|k|m|g)
$ArchivePassword       = "y(PJ8G2{cn$Ub4f>"  	# Password to 7z archive

<###   LETSUPLOAD API VARIABLES   ###>
$UseLetsUpload         = $true                  # True will run upload routine
$APIKey1               = "KEY1"  # Get key from letsupload.io
$APIKey2               = "KEY2"  # Get key from letsupload.io
$IsPublic              = 0                      # 0 = Private, 1 = Unlisted, 2 = Public in site search
$MaxUploadTries        = 5                      # Maximum number of upload tries before giving up

This is the command what i have in hmsbackupfunctions.ps1

Code: Select all

<#  7-zip archive creation function  #>

Function MakeArchive {
	$StartArchive = Get-Date
	Debug "----------------------------"
	Debug "Create archive : $BackupName"
	Debug "Archive folder : $BackupTempDir"
	$SevenZipExe = "$SevenZipDir\7z.exe"
	$VolumeSwitch = "-v$VolumeSize"
	$PWSwitch = "-p$ArchivePassword"
	Try {
		If ($PWProtectedArchive) {
			$SevenZip = & cmd /c $SevenZipExe a $VolumeSwitch -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -mhe=on $PWSwitch "$BackupLocation\$BackupName\$BackupName.7z" "$BackupTempDir\*" | Out-String
		} Else {
			$SevenZip = & cmd /c $SevenZipExe a $VolumeSwitch -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -mhe=on "$BackupLocation\$BackupName\$BackupName.7z" "$BackupTempDir\*" | Out-String
		}
		Debug $SevenZip
		Debug "Archive creation finished in $(ElapsedTime $StartArchive)"
		Debug "Wait a few seconds to make sure archive is finished"
		Email "[OK] 7z archive created"
		Start-Sleep -Seconds 3
	}
	Catch {
		Debug "[ERROR] Archive Creation : $($Error[0])"
		Email "[ERROR] Archive Creation : Check Debug Log"
		Email "[ERROR] Archive Creation : $($Error[0])"
		EmailResults
		Exit
	}
}

gotspatel
Senior user
Senior user
Posts: 347
Joined: 2013-10-08 05:42
Location: INDIA

Re: hMailServer Offsite Backup

Post by gotspatel » 2021-01-25 09:13

request to mods if inappropriate please remove my both previous posts.

7z command line does not accept passwords with special character unless provided in " " Quotes. as per this
https://sourceforge.net/p/sevenzip/disc ... /2bbf54b7/
https://stackoverflow.com/questions/216 ... characters

I tired that also but still not accepting.

I tired here first hmsbackupfunctions.ps1

$PWSwitch = "-p$"ArchivePassword""

Secondly in hmsbackupconfig.ps1

$ArchivePassword = ""P@ssw0rd2020""

Both experiments failed. Any suggestion for using of specialcharacters password in this script.

Post Reply