Skip to Content
It is currently December 10th, 2018, 2:28 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: June 27th, 2018, 6:57 am 
Offline
New User
New User

Joined: November 30th, 2013, 5:17 am
Posts: 4
Mastacheata wrote:
I would suggest leaving the SAM Backups alone and using mysqldump instead.
Here's how I automated that on my machines: (You might need to adjust the paths if you used different MySQL versions or installed to a different location)
viewtopic.php?p=206176#p206176

As of SAM Broadcaster 2017.8 it has a built-in mechanism to execute external commands, so you could get the backup done using mysqldump without using Windows Task Scheduler at all.

Dear Mastacheata,

Sir, I wish to thank you 1,000 times for your time & advice..Alas, that will take too long but seriously.
Thank you from the bottom of my heart!! <3 <3 <3
I have been dealing with trying to solve this for now 5 days. (As you can see from date and time of my post.) I did attempt to follow this plan of attack but am very limited in Mysql language syntax. I will not go into details of my travels during the past 5 days but will tell you that it has been Extremely Ugly! :oops: :oops: & again :oops:
I am fairly sure that I will be able to recreate this in my machine and will definitely be back to inform you of my success. :D
Sincerely,

Shannon Marissa


Top
 Profile  
Reply with quote  
PostPosted: June 27th, 2018, 4:39 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7652
Location: Aachen (Germany)
Shannons69 wrote:
Alas, that will take too long but seriously.

Huh? Take too long?
Now I'm really curious about your idea of long and short timespans.

As you must obviously already know the username and password to your MySQL Server, those two blanks are the easiest to fill in.
Then you need to find out the path to where you installed the MySQL Server.
That should be pretty easy to find: It's eiter C:\Program Files\MySQL\MySQL Server x.x or C:\Program Files (x86)\MySQL\MySQL Server x.x or you changed the path to something custom, in which case you should definitely know where it is.

That's all that needs to be filled out.
Shouldn't take more than 2 minutes to figure those 3 out.

Now you need to create a batch file:
Create a new text file in Notepad and make sure to select the All (*.*) type in the dropdown when saving, so the filename is really something.bat and not something.bat.txt

Last step:
Run a command as admin. Search for CMD, right-click the dosbox icon, select run as administrator, type in the path to your just created bat file and hit enter.

Everything done thereafter.
Shouldn't take more than 10 minutes at most.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: June 29th, 2018, 11:56 pm 
Offline
New User
New User

Joined: November 30th, 2013, 5:17 am
Posts: 4
To Moderators - I now know why you received "3" of the same posts from me, It is NOT my fault.
Using the Chrome browser - created post using 'quick reply' - Hit submit once I was done. Nothing happened. I hit submit once again and it took the same post into the editor. My post was still not visible so I changed font color (Why not, it was there.) and submitted the 3rd time.

This time however I was able to see two (2) and was able to edit this one. Hence my attempt to notify you of what happened. I did not see a 'delete' option. Once this has been read - please delete it for me and please look into why this occurred. I take great pride in being not only courteous but also accurate in anything I post to a forum. (ANY forum)

Shannon Marissa


Last edited by Shannons69 on June 30th, 2018, 12:10 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: June 29th, 2018, 11:59 pm 
Offline
New User
New User

Joined: November 30th, 2013, 5:17 am
Posts: 4
Good morning Mastacheata,

Sadly, you missed my attempt at humor.. :$ It would take me too long to thank you 1,000 times.. ;)
Anyways, your help does allow me to create a backup and I even was able to get as far as to not have to type a password each and every time but alas, there is no way to automate it.
It has to be done with Admin privileges to execute the Mysqldump - In Windows 10, the only way to do this is with PowerShell. To be able to get it to be automated, the script needs to be written inside of PowerShell. Which means that adding the date to the backup file name is not possible nor is it possible to use it with Scheduler. My newly created batch file is NULL. :'(

I still wish to thank you for your time once again and it is not for waste I am sure as someone - sometime will have the same problem. (One of the reasons that I came back as well.)
Hopefully, we both will be able to save some of the frustration that I have felt.

The script must be created in PowerShell using "cmdlets" of which I am off to learn about... Right now. ;)
So once again...Not 1,000 times (A) but just once..
Thanks!
Shannon Marissa

_________________
Shannon Marissa


Top
 Profile  
Reply with quote  
PostPosted: June 30th, 2018, 10:24 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7652
Location: Aachen (Germany)
Shannons69 wrote:
Sadly, you missed my attempt at humor.. :$ It would take me too long to thank you 1,000 times.

Hahaha, oh sorry, I completely misunderstood that. And as much as I'd like to blame it on poor understanding of the english language (which still happens from time to time, especially when people want to be sarcastic or have slight undertones), I must admit that it was just me reading only half of the words in your post.

Quote:
It has to be done with Admin privileges to execute the Mysqldump

You can just add another checkbox in the task scheduler to run a task with admin privileges. Just add the "/RL HIGHEST" option to the command for creating the task:
Code:
schtasks /Create /SC WEEKLY /TN MySQLBackup /ST 22:00 /TR "c:\path\to\the\above\file.bat" /RL HIGHEST

You might want to delete the old task first. Either by looking it up in the task scheduler by hand or by running
Code:
schtasks /DELETE /TN MySQLBackup


As for PowerShell CmdLets: Once you enabled running PowerShell scripts at all, there's nothing keeping you from just typing the same stuff found in a batch file. You only get addon functionality and barely loose anything that was there in CMD batch files.
Self-elevating PowerShell scripts will only work in interactive context as they require confirmation from the user. You can't use that for running a powershell script in user mode from the task scheduler and then have it magically get admin privileges. That would completely undermine the privelege separation of Windows.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group