Comments (8)
I agree this would be something kind of nice to have. Every time I think about a good way to implement this the main trouble piece is limitations to the xbmcvfs module. This module is excellent in that it is the "backbone" of the backup addon. It handles all the underlying os file code and allows transparent use of the various protocols for reading/writing files. The downside is that it would be extremely difficult to implement any sort of compression since the python module can do very limited operations on individual folders/files. Once the files are on the remote system I can't really do anything with them.
One thing I have been wondering about though is only transferring modified files. With Gotham there are some methods to get modified and creation times for files now. Only transferring what needs to be transferred would be kind of nice for limiting bandwidth, especially if you are moving those off-site via another syncing tool or using the Dropbox method directly. This would almost be getting in the realm of "incremental" backups so there would need to be a common starting point (full backup) and rotation scheme but could be doable. Would something like this help you out?
from xbmcbackup.
You're right, the xbmcvfs doesn't really allow a clean solution for writing a compressed file. Although it should be possible to let Python zipfile the data using the ZipFile module combined with a xbmcvfs.File
object. Since it behaves as a normal file including seek methods.
Effectively it should be possible to do this (theoretically of course):
import zipfile
import xbmcvfs
def compress_files(filename, *files)
file_ = xbmcvfs.File(filename, 'w')
with file_.ZipFile(file_, 'w') as zip:
for file_ in files:
zip.writestr(filename, xbmcvfs.File(file_).read())
But a differential copy would help as well, is it possible to set the mtime using the xbmcvfs api actually?
from xbmcbackup.
That is very interesting, I hadn't thought of using the File class and doing it that way. I'd have to do some testing but I wonder if this would "play nice" if trying to zip directories across network shares? I'll have to take your code for a spin and see what happens in different situations.
As you said earlier, zipping the file will only gain you so much if your archives are very large anyway. Maybe a combination of compression and incremental copies would help reduce the total size? More investigation is needed for sure. Definitely given me a lot to think about here.
from xbmcbackup.
move the files locally then zip the backup dir then transfer the files? this isn't possible?
from xbmcbackup.
This is possible, since the compression would then happen locally and is totally doable. I guess my reservation with this is you have to make sure the local drive has enough space for this. This can be done fairly trivally but I guess I have a personal objection to it. Just seems like you shouldn't require backup software to duplicate files on your local filesystem before sending it off for archiving. For small form factor systems (thinking RPI type stuff here) the SD card probably won't have the space for this. Not really the addon's problem I guess but seems kind of sloppy.
On the flip side - is having the compression worth the extra file space on the frontend? If you're backing up to the cloud lots of people would probably say yes.
from xbmcbackup.
I back up to a store over cifs, this means that it's very slow (since it's one file at a time). Doing it locally will make it much faster on top of reducing storage space.
from xbmcbackup.
Take a look at the request I just merged in. Hopefully this will help with the compression issue. I posted some comprehensive info about how it all works here: http://forum.xbmc.org/showthread.php?tid=129499&pid=1763652#pid1763652
from xbmcbackup.
yep, very nice, can't test this week though, will let you know if I find any issues though
from xbmcbackup.
Related Issues (20)
- Error when running or starting - missing package? HOT 3
- Invalid sytntax
- Error 'ModuleNotFoundError' HOT 1
- How to install beta channel? HOT 2
- 1.6.7: won't remember settings HOT 4
- Dropbox error "Authorize this remote service in the settings first" HOT 3
- float division by zero when attempting to write file with "Compress Archives" HOT 1
- Feature Request: Restore Backup from CLI HOT 4
- "Error: Remote or zip file path doesn't exist" HOT 1
- 🖐️Backup incompatible with kodi 20 Nexus HOT 4
- Cloud Storage Dropbox HOT 1
- Unable to restore a backup from another device HOT 2
- Unable to restore on kodi 20 HOT 1
- Ajouter un libeller sur le nom de l'archive zip HOT 1
- [FEATURE] Export databases as nfo HOT 1
- 👋Failed Installations (Inpustream...) HOT 8
- Wrong date parse (locale) HOT 5
- Scripting Restore HOT 5
- Hangs endlessly HOT 1
- Cannot restore from SMB filesystem HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xbmcbackup.