942,963 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 1796
  • Python RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 23rd, 2009
0

Python backup program

Expand Post »
I know it seems that everyone is writing a 'backup' program these days. I started working on this a couple weeks ago and now my dream just keeps growing.

I have written a script that uses rsync to backup selected files and folders in my home directory to an external drive. It generates a backuplog and transfers items that have been moved or deleted to a directory labeled with the date and time of the backup. I have attached a .zip with the code.

What I would like to end up with is a gui much like Grsync. Giving the user an interface to:
1. build the exclude and include list as desired
2. set rsync flags
3. set the source and backup directories
4. turn on or off the function that removes hidden items from the increments directory on the backup media
(MORE TO COME I am sure)

Also is there a way to force a shell prompt when setting the script up as a cron job in Linux?

thanks
coffeebox
Attached Files
File Type: zip savethehouse.zip (19.5 KB, 107 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
coffeebox is offline Offline
6 posts
since Nov 2009
Nov 23rd, 2009
0
Re: Python backup program
Maybe instead of using rsync, you can implement your own crossplatform version of rsync. You could also multithread is and/or use the multiprocessing module to provide multiple CPU support so copying can go much faster.

Another good idea is to make a daemon out of it, and have it backup to a certain source at given times every so often. Consider using wxpython for GUI, and docking the daemon on the system tray. It would be pretty sweet.
Reputation Points: 35
Solved Threads: 22
Junior Poster
ov3rcl0ck is offline Offline
113 posts
since Sep 2009
Nov 23rd, 2009
0
Re: Python backup program
Click to Expand / Collapse  Quote originally posted by ov3rcl0ck ...
Maybe instead of using rsync, you can implement your own crossplatform version of rsync. You could also multithread is and/or use the multiprocessing module to provide multiple CPU support so copying can go much faster.

Another good idea is to make a daemon out of it, and have it backup to a certain source at given times every so often. Consider using wxpython for GUI, and docking the daemon on the system tray. It would be pretty sweet.

This would be cool, maybe I can evolve it as I go. But right now this is really my first Python program. If you don't mind helping out I would appreciate it. Like I said at this point I would like to stick with rsync and get my hands around it, then later move to the cross platform idea.

I will do some looking around, I think I have seen some discussions about rsync being used on Windows, and since Mac are realy running shiny Linux/BSD it should work there to.

thanks for the input
coffeebox
Reputation Points: 10
Solved Threads: 0
Newbie Poster
coffeebox is offline Offline
6 posts
since Nov 2009
Nov 24th, 2009
0
Re: Python backup program
If you set up some sort of source code repos I'd be happy to help, otherwise I could just post some code here or PM it to you.
Reputation Points: 35
Solved Threads: 22
Junior Poster
ov3rcl0ck is offline Offline
113 posts
since Sep 2009
Nov 24th, 2009
0
Re: Python backup program
Click to Expand / Collapse  Quote originally posted by coffeebox ...
... since Mac are realy running shiny Linux/BSD it should work there to.
Mac OS X is based around Darwin UNIX, a version of UNIX that derived from NEXTSTEP, which derived from BSD. OS X Contains no BSD code nor NEXTSTEp code anymore.
Reputation Points: 35
Solved Threads: 22
Junior Poster
ov3rcl0ck is offline Offline
113 posts
since Sep 2009
Nov 24th, 2009
0
Re: Python backup program
Click to Expand / Collapse  Quote originally posted by ov3rcl0ck ...
If you set up some sort of source code repos I'd be happy to help, otherwise I could just post some code here or PM it to you.
I have setup a repo herehttp://code.google.com/p/savethehouse/. This is my first time doing this please let me know if I did it correctly.

coffeebox
Reputation Points: 10
Solved Threads: 0
Newbie Poster
coffeebox is offline Offline
6 posts
since Nov 2009
Nov 30th, 2009
0
Re: Python backup program
I'll check it out. Maybe help out with the multiprocessor support.
Reputation Points: 35
Solved Threads: 22
Junior Poster
ov3rcl0ck is offline Offline
113 posts
since Sep 2009
Dec 1st, 2009
0
Re: Python backup program
Click to Expand / Collapse  Quote originally posted by ov3rcl0ck ...
I'll check it out. Maybe help out with the multiprocessor support.
Sounds good ov3rcl0ck, I did some changes to the structure of the code. You can find the most recent code under Changes on the host sight.

I do have one question though, I am starting to work on the GUI using Tkinter, I just noticed that when I import the main code body it is run. This seems odd. Shouldn't the import just set up the code for use, calling and such?

Anyway for the time being I will leve this import out as I do the low level GUI building.

Thank you for the offer to help.
coffeebox
Reputation Points: 10
Solved Threads: 0
Newbie Poster
coffeebox is offline Offline
6 posts
since Nov 2009
Dec 3rd, 2009
0
Re: Python backup program
TKinter doesn't give a very native look or feel, I recommend WXpython, it can use GTK themes, or have a windows look.

But if you insist on using TKinter I can help you with that also, but I recommend that you check this out http://www.wxpython.org/tutorial.php

Right now I'm working on a python based, crossplatform(and portable) remake of rsync. It will give the ability to back up permissions, owner, zip/gzip/tar the files for more compact storage, and provide multiprocessor support.
Reputation Points: 35
Solved Threads: 22
Junior Poster
ov3rcl0ck is offline Offline
113 posts
since Sep 2009
Dec 3rd, 2009
0
Re: Python backup program
Click to Expand / Collapse  Quote originally posted by ov3rcl0ck ...
TKinter doesn't give a very native look or feel, I recommend WXpython, it can use GTK themes, or have a windows look.

But if you insist on using TKinter I can help you with that also, but I recommend that you check this out http://www.wxpython.org/tutorial.php

Right now I'm working on a python based, crossplatform(and portable) remake of rsync. It will give the ability to back up permissions, owner, zip/gzip/tar the files for more compact storage, and provide multiprocessor support.

Are you hosting the code anywhere that I may take a look at it? Sounds allot like what I would like this project to end up being. I started playing with WXpython last night and am starting to get it.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
coffeebox is offline Offline
6 posts
since Nov 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Loops and dynamic variables
Next Thread in Python Forum Timeline: code issue-writing series of files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC