Skip to content

ben-aslan/mssql-backup-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

MSSQL Backup

With this script, you can backup mssql database and send it to Telegram with the help of the Telegram bot so that it is always available!



How does it work

Step 1: run the script

First, you run this command on your server

bash <(curl -Ls https://github.com/ben-aslan/mssql-backup-script/raw/main/backup.sh)

Step 2 : Token setting

Then it asks us for bot token, you have to create a bot from https://t.me/BotFather and give the token

Step 3: Set chat id

Then it asks us for a chat ID, and to get your chat ID or the channel you set aside for backup, you must forward a message from yourself or the channel to this https://t.me/userinfobot bot, which will give you a chat ID.

Step 3: Set chat id

Then it asks us for a chat ID, and to get your chat ID or the channel you set aside for backup, you must forward a message from yourself or the channel to this https://t.me/userinfobot bot, which will give you a chat ID.

Step 4 : Caption setting

The next step asks you for a caption, which you can leave blank

Step 5 : Set host

The next step asks you for a host, default is 127.0.0.1

Step 6 : Set port

The next step asks you for a port, default is 3306

Step 7 : Set user

The next step asks you for a db user

Step 8 : Set password

The next step asks you for user password

Step 9 : Cronjob setting

The next step asks you to run a cron job to determine when the robot will back up and send
whose format is like this:
0 1
The first value, which is 0, is the minute, and the second value, which is 1, is the hour
The minimum number for minutes is 0 and the maximum is 60
The minimum number for the hour is 0 and the maximum is 24
Enter 0 for both to set backup once every minute
In the example above, it is backed up once every hour
Note that there is a space between both values

Step 10 : question of removing previous crown jobs

Then it will ask you if you want to delete the previously defined cron jobs or not?
Enter y if you want it to be cleared otherwise enter n

Possible problems

If you have entered everything correctly, the backup file should be sent to you once, otherwise there is a problem in this process and you can raise your problem from the issues

Help us

I have tested this script only on Ubuntu and developers can help us to develop this script for other operating systems.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages