B4J Code Snippet Howto: Backup your code/scripts/files

There are other ways but this one is my favourite. All your need is Google Drive and an Google account.

Install it to your pc. It will create a new folder where you can drop files/folders to synchronize automatically.

Create a windows *.bat file with this content (change the names, path's and folders)

B4X:
set source=C:\xampp\htdocs\*.*
set destination="C:\Users\Klaus\Google Drive\XamppSave\HtdocsData"
xcopy %source% %destination% /m /E /Y

set source="C:\Users\Klaus\Documents\Visual Studio 2013\Projects\*.*"
set destination="C:\Users\Klaus\Google Drive\VS-Sicherung\Projects"
xcopy %source% %destination% /m /E /Y

set source="C:\Users\Klaus\Documents\B4A Apps\KlausSourceCode\*.*"
set destination="C:\Users\Klaus\Google Drive\b4a"
xcopy %source% %destination% /m /E /Y

set source="C:\Users\Klaus\Documents\B4JApps\*.*"
set destination="C:\Users\Klaus\Google Drive\b4j"
xcopy %source% %destination% /m /E /Y

set source="C:\Users\Klaus\Documents\RaspBerry\*.*"
set destination="C:\Users\Klaus\Google Drive\RaspBerry"
xcopy %source% %destination%  /m /E /Y

It is quite self explaning.

Good part: The script (parameter /m) set's the archive bit when copied. So every file is copied only once. If it changes, windows deletes the bit and it will becopied again = newer version.

You can add zip functions, too.
 

Mashiane

Expert
Licensed User
Longtime User
Seeing your xcopy reminded me of yesterday. My last backup was saturday, my laptop crashed yesterday. Took the whole day to fix, more over I had to write such scripts to transfer my ssd data to my external drive for the un-back-uped files using xcopy. #BackUpEveryDay I still tell myself.
 

AnandGupta

Expert
Licensed User
Longtime User
Burnt my finger once. Now I auto run backup each day on machine start, copying all source folders of various development (Xbase++, HMG, B4A, Autohotkey etc.) to backup drive.

It is in same hdd, but different drive. And each month I make CD of the the backup folders.

Have Google Drive, but not gone for backup, as network is slow and still costly for big data backup.

Regards,

Anand
 

Mashiane

Expert
Licensed User
Longtime User
Have Google Drive
If data was not so expensive in South Africa such would be easy. Im using Mega but then again, one turns it off until specific times. My backup ran last nite, will do an incremental one tonight. My tiny thing here does not have a CD/DVD drive, so will have to contend with whatever safe way there is.
 
Top