gsrsync script

235 views
Skip to first unread message

Sebastián Marconi

unread,
Jun 1, 2011, 10:51:00 AM6/1/11
to gsutil-...@googlegroups.com
Hi, 
While browsing the available alternatives to backup a big number of files to Google Storage, I've found this gsBackup script, but it required a sqlite database to run (it brought me synchro problems while modifying the bucket manually) so I've modified it heavily, using "gsutil ls -l" instead of the database. 

Calling gsscript will only copy over new or modified files, also remote files not present locally will be removed. 

Usage: gsrsync PATH BUCKET [--dry-run]
Example: gsrsync ./ my_bucket

Requires:
 - Python 2.6+
 - Gsutil installed and running

Hope it helps this anyone!
---
Sebastián Marconi
gsrsync.gz

Sebastián Marconi

unread,
Jun 1, 2011, 10:53:35 AM6/1/11
to gsutil-...@googlegroups.com
Direct link to the script

MPartipilo

unread,
Jul 1, 2011, 5:26:10 AM7/1/11
to gsutil-discuss
It seems your script doesn't download new files added to the bucket.

Or am I missing something here?

On Jun 1, 4:53 pm, Sebastián Marconi <sebastianmarc...@gmail.com>
wrote:
> Direct link to the scripthttp://pastebin.com/P1pLDYy5

MPartipilo

unread,
Jul 1, 2011, 7:59:32 AM7/1/11
to gsutil-discuss
I get it now.

Since there is no local or remote deletion registry, there is really
no way to know whether a local/remote file is new or should be deleted
from the remote/local location.

The current script acts more like a mirror backup to Google Storage.

I needed the opposite, so I changed the script a bit to adjust it to
my needs. I wish I could just make "gsutil ls" to show only files
modified after a certain date.

Thanks for this script, it saved me lots of time :)

Brian Nest

unread,
Jul 12, 2011, 8:36:12 PM7/12/11
to gsutil-discuss
Hi MPartipilo,

VEry sueful your comments. I have the same issue, I have to download
data from a public Google Storage and I need to get only the files
uploaded since the last sync. The storage is already publishing the
latest update date of each file. How did you solve it?

Thanks!!!

Brian

On Jul 1, 8:59 am, MPartipilo <michelangelo.partip...@gmail.com>
wrote:
> I get it now.
>
> Since there is no local or remote deletion registry, there is really
> no way to know whether a local/remote file is new or should be deleted
> from the remote/local location.
>
> The current script acts more like a mirror backup to Google Storage.
>
> I needed the opposite, so I changed the script a bit to adjust it to
> my needs. I wish I could just make "gsutills" to show only files

nt...@gimasys.com

unread,
Nov 15, 2012, 5:01:06 AM11/15/12
to gsutil-...@googlegroups.com
Hi,

I try sync folders and files from local computer to google storage, but when i run gsrsync <path to local folder> <bucket>, folders and sub folders is not create. files upload to bucket. How can i sync all files and foldersv??

Thanks.
Reply all
Reply to author
Forward
0 new messages