Syncing files between local and remote pyramid-app - anything built-in?

67 views
Skip to first unread message

Christian Benke

unread,
Mar 21, 2013, 9:12:41 AM3/21/13
to pylons-...@googlegroups.com
Hello!

I want to sync data(JPG-files and JSON) between a local and a remote
Pyramid-app. Is there any built-in capability for that in Pyramid?
Otherwise i'd use the python-requests HTTP library. All comments are
appreciated!

Best regards,
Christian

--
Central Asia by bike, starting May 2013 - http://poab.org

Jonathan Vanasco

unread,
Mar 21, 2013, 5:41:31 PM3/21/13
to pylons-discuss
what about using `rsync` on the command line ?

Whit Morriss

unread,
Mar 21, 2013, 5:42:48 PM3/21/13
to <pylons-discuss@googlegroups.com>
or git + rsync if you need a history.

d. "whit" morriss
Platform Codemonkey
wh...@surveymonkey.com



On Mar 21, 2013, at 4:41 PM, Jonathan Vanasco <jona...@findmeon.com>
wrote:

> what about using `rsync` on the command line ?
>
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jonathan Vanasco

unread,
Mar 21, 2013, 5:55:54 PM3/21/13
to pylons-discuss


On Mar 21, 5:42 pm, Whit Morriss <w...@surveymonkey.com> wrote:
> or git + rsync if you need a history.

that's really smart!

Christian Benke

unread,
Mar 21, 2013, 6:08:28 PM3/21/13
to pylons-...@googlegroups.com
On 21 March 2013 22:41, Jonathan Vanasco <jona...@findmeon.com> wrote:
> what about using `rsync` on the command line ?

I'm considering it, probably a mix of binary via rsync and json via
POST. I need to parse that data on the remote end, so some kind of
feedback/callback if everything went fine would be nice. But that's
only really necessary for the json-part, not for the binaries.

Looks like i'll stick with python-requests then. The WebOb-docs are
down unfortunately...

Best regards,
Christian

Jonathan Vanasco

unread,
Mar 21, 2013, 6:26:29 PM3/21/13
to pylons-discuss
you could do a command-line pyramid tool that runs on a crontab and
wraps the rsync + cleanup routines.

Christian Benke

unread,
Mar 21, 2013, 7:15:12 PM3/21/13
to pylons-...@googlegroups.com
> you could do a command-line pyramid tool that runs on a crontab and
> wraps the rsync + cleanup routines.

Hu? What's your idea about?

The sync will be started by user-input. It's a local webinterface used
for publishing to a public website - when a internet connection is
available...

Jonathan Vanasco

unread,
Mar 21, 2013, 7:29:59 PM3/21/13
to pylons-discuss


On Mar 21, 7:15 pm, Christian Benke <benkoka...@gmail.com> wrote:
> Hu? What's your idea about?
>
> The sync will be started by user-input. It's a local webinterface used
> for publishing to a public website - when a internet connection is
> available...

You can "bootstrap" pyramid onto the command line (
http://docs.pylonsproject.org/projects/pyramid/en/1.4-branch/narr/commandline.html
)

It's a lifesaver for building maintenance scripts -- you have full
access to your pyramid environment, or can just write whatever you
need in some customized script-only logic.

you could easily use a commandline script to wrap all the rsync stuff
(via popen or whatever), then do all the post-processing ( you'd have
access to your helpers and models ). if you're doing periodic syncs,
run it through a crontab. if you're doing a web based trigger... you
could have it trigger a new subprocess ( though i'd probably `touch`
and `rm` a file to use as a semaphore to know if the process is
already running )

does that make sense ?

Christian Benke

unread,
Mar 21, 2013, 7:55:55 PM3/21/13
to pylons-...@googlegroups.com
> you could easily use a commandline script to wrap all the rsync stuff
> (via popen or whatever), then do all the post-processing ( you'd have
> access to your helpers and models ). if you're doing periodic syncs,
> run it through a crontab. if you're doing a web based trigger... you
> could have it trigger a new subprocess ( though i'd probably `touch`
> and `rm` a file to use as a semaphore to know if the process is
> already running )
>
> does that make sense ?

Ah, yes it does!
Reply all
Reply to author
Forward
0 new messages