markcox / picasastarter

Automatically exported from code.google.com/p/picasastarter
0 stars 0 forks source link

/backup command-line option to initiate unattended PS Backup #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Because I have designated a particular computer for backing up, and this 
computer is not a primary computer, I have a (another) feature request.  How 
about a "/backup" command line switch, so I can schedule a backup of my shared 
Picasa store?  It would essentially do everything it normally does *EXCEPT* 
actually launch Picasa, and bypass the prompt for backup.  So a command like:
\\server\share\PicasaStarter\PicasaStarter.exe "Our Album" /backup
would let me schedule a weekly backup from a certain machine.

Original issue reported on code.google.com by bkea...@keadle.net on 22 Nov 2011 at 3:25

GoogleCodeExporter commented 9 years ago
Because of the way the command line scanner in PS works it would probably be 
easier to put the /backup switch before the database name: ..\PicasaStarter.exe 
/backup "Our Albums", but this looks like a nice feature and should be very 
easy to implement.
Earl

Original comment by earlb...@gmail.com on 29 Nov 2011 at 6:17

GoogleCodeExporter commented 9 years ago
This Enhancement has turned out to not be easy, because the command line 
version of PS does not open a window, and the Backup functionality does not 
work correctly without a window to display the progress window in.

Is there an easy way to make this work without having to make the commandd line 
version open a window?

Do we think this option is important enough to rewrite the Backup function?

Original comment by earlb...@gmail.com on 16 Feb 2012 at 8:02

GoogleCodeExporter commented 9 years ago
Hey...good to hear from you - it's been a while.  However, I have nothing
to offer in this regard.

Original comment by bkea...@keadle.net on 16 Feb 2012 at 8:51

GoogleCodeExporter commented 9 years ago
Indeed been a while Bryan :-)...

Normally the backup object should be usable as well without handling the events 
sent to report the progress... but I didn't test it...

Original comment by pieter.r...@gmail.com on 16 Feb 2012 at 9:24

GoogleCodeExporter commented 9 years ago
Hey Pieter!
Ok, maybe I just don't know how to call it correctly, I'll go back and look at 
it again and try to learn something. 
I had the command line parser looking for the /backup command and all that 
seemed to work fine, but I got a little hung up on showing the progress. I do 
think there should be some progress indicator or at least a chance to cancel 
though. What do you think?

I started to duplicate the backup code in program.cs, a while back, and maybe I 
should just have called it directly.
Earl

Original comment by earlb...@gmail.com on 17 Feb 2012 at 1:55

GoogleCodeExporter commented 9 years ago
To show progress or be able to cancel I think the only/easiest way is to show 
the progress bar anyway, or did you have another idea?

Original comment by pieter.r...@gmail.com on 17 Feb 2012 at 7:48

GoogleCodeExporter commented 9 years ago
I don't have another idea. :-( 
 My main problem is that I don't know how to structure things successfully for Async threads. At the moment, I have made a second progress form that doesn't need a parent form (because mainform isn't there) and I run it from program.cs. When I did this the main program ended after starting the thread, which brought down the thread, so I need to block that and..... For my next try I will probably create a parent form to contain everything while doing the backup.... The good part is I am learning things, the bad part is that things keep getting messy.

When things get messy like this I know I am approaching it wrong, so could you 
give me an outline or hint of how you would do it? 

 ... Thanks!

Original comment by earlb...@gmail.com on 18 Feb 2012 at 6:07

GoogleCodeExporter commented 9 years ago
I finally just added another form to contain the command line backup function, 
and a progress form also.  It isn't very pretty, but seems to work.

Original comment by earlb...@gmail.com on 22 Feb 2012 at 1:47

GoogleCodeExporter commented 9 years ago
Added a test in the SerializeSettings class that only writes out the settings 
if they have changed. This prevents the file date from changing if there were 
no changes to the  settings file so it won't show as changed during backup.
Implemented this by serializing the settings object to a temp file and then 
comparing the PicasaStarterSettings file data to the temp file data. If they 
are the same the settings are not saved.
-efb

Original comment by earlb...@gmail.com on 28 Feb 2012 at 12:18