drive icon indicating copy to clipboard operation
drive copied to clipboard

how to check that the Google Drive folder from where I synchronize is empty before the pull?

Open ramonpks opened this issue 5 years ago • 3 comments

Good afternoon, I have a small problem that I think I can solve with your help.

In a script I pull from the folder where I make the backups to my example device: drive pull folderbackup How could I make this process before doing it check from the script that the car folder folderback google is empty before the process ??? If you perform this process while still normal, the problem that is adjacent is that the synchronization of the backup folder of the device deletes the content, you would need to know how I can avoid this from the script please.

ramonpks avatar Jun 02 '19 18:06 ramonpks

Drive makes provision for this in two ways, study the instructions on these options and then test on some disposable data.

drive pull -no-clobber folderbackup

another way is to disable the delete function for a particular command, eg

drive pull -exclude-ops "delete" folderbackup

regards CB

CountryBumkin avatar Jun 02 '19 21:06 CountryBumkin

The second option to exclude the delight of the pull command is not viable, tonight I will try the first option of the -no-clober, what I want to do is the following, do a pull to a folder in Google Drive, and if it is empty that does not perform the pull, instead if it contains files that if you pull, I do not know if you can discern in this client the pull, thank you very much and I hope your prompt answer.

ramonpks avatar Jun 03 '19 12:06 ramonpks

Neither option is exactly what I needed, however ma have been helpful, the two options what they do is to do the synchronization but omitting the delete command in in any case, I just wanted to omit the delete command only and only if the google drive folder to synchronize was empty

ramonpks avatar Jun 04 '19 08:06 ramonpks