How to replace Dropbox OneDrive or sugarsync with syncthing

If your sick of paying for synchronization software that is overpriced or your running out of space using a free account, Syncthing is one answer, particularly if you have computers in multiple locations or have a good friend or family member that is happy to share some HDD space and internet bandwidth to allow you to do offsite automatic backups.

We recently discovered SyncThing and have been very impressed with it’s features, functionality and security. If you have not yet heard of SyncThing, then you don’t know what your missing out on. It has many awesome features, a few of which are listed below.

  • Syncthing is an amazing free software that allows you to share folders between networked devices, such as laptops and mobile phones.
  • Syncthing has clients for windows, mac and linux computers
  • Syncthing has clients for android and apple ios (ipad, iphone, ipod) although the later has limited support.
  • Sycthing is secure.
  • Syncthing can be setup to sync in a mesh or spoke.

Backup MYSQL databases on Windows 10 free Script

We needed a simple way to automatically Backup MySQL on windows 10 for free. Our development and testing environments required:

  • The convenience of backing up all DBs (such as This Script does).
  • Ability to exclude some of the DBs in each machine.
  • Date stamped backups, so changes are backed up each day.
  • Free and preferably open-source.
  • Easy to integrate into our existing backup scripts.

A quick search showed up nothing. We decided to expand the above mentioned script functionality to include what we require. Provided below is the important parts of the script:

:: allows for skipping of particular databases
set SkipThis=0
for /d %%f in (*) do (
    set /A Counterf=!Counterf!+1
    :: remove echo here if you like
    echo processing folder "%%f"
    pushd "%~dp0"
        set Countera=0
        for %%a in (*.exclude) do (
            rem increment the counter, so we know how many files we have read.
            set /A Countera=!Countera!+1
            if %Debug% == 1 echo DEBUG - Exclude file found: "%%~na"
            if %%a == %%f.exclude set SkipThis=1
            if !SkipThis! == 1 if %Debug% == 1 echo DEBUG - Skipping Backup of "%%f"
            )
        If %Debug% == 1 echo DEBUG - !Countera! exclude files checked
    popd

    if !SkipThis! == 0 %mysqldump% --host="localhost" --user=%dbUser% --password=%dbPassword% --single-transaction --add-drop-table --databases %%f > %backupDir%\%dirName%\%%f.sql
    if !SkipThis! == 0 %zip% a -tzip %backupDir%\%dirName%\%fileSuffix%_%%f.sql.zip %backupDir%\%dirName%\%%f.sql
    if !SkipThis! == 0 set /A Counterb=!Counterb!+1

    :: make sure to set this back to normal, so we don't skip the next DB backup as well
    set SkipThis=0
)
echo DONE - !Counterf! DBs found, !Counterb! DBs backed up

We then just need to create some blank files with “.exclude” extension. The “.exclude” files have the same name as the DB to exclude. Example such as “sys.exclude” will exclude the “sys” DB from backups

Licensing is as usual, this script is Open Source and we provide a download for your easy of use.

Troubleshooting

  1. If backups are not created, check all your location variables are set correctly

How to Use

  1. Download the MySQL Backup Script and extract into a suitable location.
  2. Open up “MySQLBackup.bat” in notepad++ (or similar).
  3. You will need to change the dbUser, dbPassword, backupDir, mysqldump, mysqlDataDir and zip file/app locations on lines 4-9.
  4. Save the file and run (you can open a command prompt by typing cmd into the title bar of explorer)
  5. This script will now be executable. Go to your command prompt and run this to backup your databases.
  6. If backups are not created, check all your location variables are set correctly

Next time you need to Backup MySQL on windows 10 for free, use this script to make it easy

YTS Backup Script

Download YTS Backup Script

YTS_Backup_script.cmd is an easily customisable backup script for Windows

Through the use of .backup files, its easy to add extra directories or files to backup when run.

To setup, we need to extract the files from the ZIP into a directory.
once extracted, edit “YTS_Backup_script.cmd” file with Notepad++ or similar.

You will then need to setup your script location & backup directory location.

  • 1) Look for “set ScriptDir=D:\files\Projects\YTS_Backup_Scripts” and change it to suite your needs.
    NOTE: This Directory name needs to not have any spaces in it, or the script will fail.
  • 2) Look for “set ScriptDrive=D:” and change it to suite your needs.
  • 3) Look for “set BackupDir=C:\Backups\Manual” and change it to suite your needs.
  • 4) Look for “set BackupDrive=C:” and change it to suite your needs.
  • 5) Open “mydocs.bac” with notepad++ by double clicking on the file, and associating with notepad++.
    Edit this File to your needs. the file contains only two lines.
    Line1 is the source file or directory for xcopy to use.
    Line2 is the destination file or directory for xcopy to use.
    NOTE: do not add extra lines to this file, as this will break the script. two lines only.
  • 6) Open “Outlook.bac” with notepad++
    Edit this File to your needs.
    to add more files to your backup, simply change add another .bac file to the script directory and enter the details correctly.

Download YTS_Backup_script