Uploads files to Google Drive for backup
- Download the code from GitHub
- Download your credentials from https://console.cloud.google.com/apis/credentials and put them into
credentials.json
file - Add some folder paths in the
config.js
$ npm install
$ node app.js
- Authenticate with your Google account via the instaructinons in the command promt
- Sitback, relax and watch as the script uploads the files into the cloud
- scans folders for files and uploads the files (no hierarchy yet)
- can delete the files after succesfull upload
- after the files have been uploaded the script stops and exits
- (not yet) notifies via telegram of any errors
Language Javascript for Node
- credentials.json - Google API credentials
- config.js - An array of folders path, whether to delete files after upload
googleapis
for Google Drive accessfs
for file system access
Basically it is a script that runs, scans the folders and performs an upload of found files to Google Drive.
If the file is uploaded, and the 'deleteAfter' is set it is deleted.
For added security the minimal oauth scope is used (the one that can access only the files that were created using the app)
To run the script at sertain intervals an external tool can be used like cron
or pm2
.
Config: a separate file config.js
and credentials.json
with Google credentials.