Auto Cloud Backup

Last updated:October 27th 2021, 11:58

Simple way to save a file (.zip) and upload it into cloud

How it works

The method use the software Task Scheduler which already existed in all Windows version.
You will set-up for each .bat file the time it runs, and by that it will follows this order:

  1. Delete the old zip file with delzip.bat
  2. Force stop the software that is using the folder you want to zip after
    • this will lead to some data loss that have not yet saved
  3. Zip the folder with zipsv.bat into specific place
  4. Uploading files into cloud using Google Drive Software
  5. Start the software that you force stop before again
    You have to set the start time for each .bat file correctly so that it wont appear any conflicts like running start.bat while you are zipping files

Requirements

Create these bat file

Remember to replace the url with yours

delzip.bat
1
2
3
4
5
6
@echo off

cd "C:\Users\tungnguyen\Desktop\Backups"
del Servers.zip

exit
stopsv.bat

Remember to set auto-stop in the server first so that you dont lose any data

1
2
3
4
5
@echo off

taskkill /f /im bedrock_server.exe /im php.exe /im cmd.exe

exit
zipsv.bat
1
2
3
4
5
6
7
8
9
10
11
echo on

for /f "tokens=3,2,4 delims=/- " %%x in ("%date%") do set d=%%y%%x%%z

set data=%d%

Echo zipping servers...

"C:\Program Files\7-Zip\7z.exe" a -tzip "C:\Users\tungnguyen\Desktop\Backups\Servers.zip" "C:\Users\tungnguyen\Desktop\Servers"

echo Done!
startsv.bat
1
2
3
4
5
6
@echo off

cd "C:\Users\tungnguyen\Desktop\Servers\Sur"
start start.cmd

exit

Setting up the google drive

Update Later