Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive as Service or background operation

I have a server thats does automatic backups, now i need to sync that backup files to google drive, but i dont want to login every day into windows server so google drive make the sync.

¿Does anyone know a way to sync or script to upload in background without user interacction?

Well i figured out, so i am posting for everyone who needs to run google drive sync app without enter to windows:

  1. create a sheduled task with action start program pointing to: C:\Program Files (x86)\Google\Drive\googledrivesync.exe
  2. add argunment: /autostart
  3. mark execute to run if the user has not logged in
  4. i have also marked execute with higher privileges
  5. the trigger is at system starts with a delay of 30 seconds, it is very important to make a delay!
  6. uncheck the option thats stops the task if it runs for more than x days, this is because google sync is always running in background.

now i have to copy the backups files to google drive folder with and cmd script + sheduled task.

like image 889
Kataku Avatar asked Nov 22 '13 15:11

Kataku


People also ask

Does Google Drive run as a service?

You can then manage Google Drive as a service. If you need to edit the settings within Drive log in as the account that the service is running under, stop the service then start Google Drive from the icon in the start menu.

Does Google Drive run in background?

Still, it runs in the background and consumes 3mAh battery.

Is Google Drive an online Backup service?

Service-level features Google Cloud products and services offer a broad range of data protection features such as Backup for GKE, Persistent Disk snapshots, Cloud SQL backups, Filestore backups, and geo-redundant Cloud Storage.


1 Answers

If you are running on a Windows Server 2003 you can try the following to run Drive as a Service:

Download and install Windows Server 2003 resource kit which can be found here

Open a command prompt and run the following:

C:\Program Files (x86)\Windows Resource Kits\Tools>instsrv GoogleDrive "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"

Next is to change the user for witch the newly added service “GoogleDrive” runs under. Change this to Administrator.

Type the following command in the command prompt to open the services snap in console:

services.msc

Choose properties on GoogleDrive service. Click on tab “Log On” Click “This account”, and select Admimistrator. Set appropriate password. Click Apply and OK

Next is to setup some registry settings for the service. Open the registry editor by typing the following command into the command prompt:

regedit

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GoogleDrive Create a new key “Parameters” Add a new string value “Application”, (type REG_SZ). Set the value to the path to C:\Program Files (x86)\Google\Drive\googledrivesync.exe /autostart. Close Registry Editor Go back to Services, and start the GoogleDrive service

This was adapted from an article about running Dropbox as a service which can be found here.

Essentially the process is to create a Windows service using the 'srvany.exe' which is a Windows service wrapper that will run any program as a service.

like image 60
Tom Maher Avatar answered Nov 02 '22 22:11

Tom Maher