Posts: 24
Joined: May 2007
Reputation:
0
eilz
Junior Member
Posts: 24
Is there a script that checks a specific folders on say xbox(1) and copies its contents to another xbox(2), but then only copys the changed/updated files/folders, similar to robocopy on windows?
I want to be able to have some kind mirror of data, but as the data only changes rarely, wanted a script which would occassional allow me to synchronise data of a specific folder on both xboxs (one downstairs and one in the bedroom)
I found a XBMCprep.zip script, but this only deletes and renames, I am not a python expert but would appreciate any help or guidance.
Eilz
Posts: 3,746
Joined: May 2004
Reputation:
20
Livin
Posting Freak
Posts: 3,746
I wrote XBMCprep to "cleanup" the new builds so they did not overwrite my customizations before I FTP them to the XBOX.
For your needs, you can get a PC based FTP client (most any will work fine) to do what you want... just setup your client to FTP from one box to the other, and only overwrite if newer - one box will need to be authoritative... e.g. the "master".
I'm not an expert but I play one at work.
Posts: 2,322
Joined: Sep 2006
Reputation:
309
A script could be written, but i guess it could only go off file sizes. But usually if a file is changed even the slightest, the filesize will change.
Wouldn't be too hard... you should look into python.
Probably would need just a single os.walk loop that checks if a dir exists, if not then creats, then checks all the files in the dir and compares sizes, if different, then overwrites.
Also, with python, this could run in the background with a little dialog progress bar or something.
I might look into tonight.
Cheers,
Stanley87
Posts: 2,322
Joined: Sep 2006
Reputation:
309
Hmm, i would do it like this.
You run the script and it asks you to browse for a backup location. Then you just browse to a network share (PC), another xbox etc.
Posts: 346
Joined: Jan 2007
Reputation:
0
2007-09-06, 21:41
The most efficient way to check for changes would be a checksum rather than file sizes wouldn't it - although given the potentially large data sizes involved that might be difficult and it would run a bit more slowly it need, however, only be done if the file sizes are identical....
Also modification date and time might also be useful a useful way of doing it. Combined with file size it should catch most changes. And if the files havn't really changed it isn't too much of a problem (although presents a potentially exploitable security hole without checksums....)
If filesize != previoussize:
If date!=previousdate:
**insert code for copying the files*
Posts: 2,322
Joined: Sep 2006
Reputation:
309
K, basically done, just need to add a little GUI.
It cross checks size OR date modified.
If either are different, it will copy new file.
It also cross-checks for deleted files/
So, it keeps a excact copy of XBMC.
Will post release link soon.
PS. it was easy - took about an hour :-D
Posts: 3,746
Joined: May 2004
Reputation:
20
Livin
Posting Freak
Posts: 3,746
stanley87,
Nice work! Can you add a filtering feature? For those of us that mod our skin there will be files that we do not want to over write (ex: home.xml, includes.xml, etc) but may want to save on the xbox as a different name (ex: home.orig)
Can you add a feature like this for specific files and a way to exclude entire folders too?
Thanks for making this reality... it has been needed for a long time!
I'm not an expert but I play one at work.
Posts: 2,322
Joined: Sep 2006
Reputation:
309
Hi Affini,
Yeh, this was just a quick little release to help a few ppl out.
Will make a propper GUI with progress bar etc and ability to have it auto backup on startup etc and a filter. Hopefully sometime this week.