(Automatic/one-tap) Photo upload to Owncloud
Hi,
I'm trying to work out a procedure for the easiest possible way to automate upload of pictures taken with the Jolla to an Owncloud server. We currently have no native application that can do it. What we do have is Rsync, and some powerful command line tools and Linux packages. With Rsync and the ShellEx application, we can reduce the effort needed to upload all new pics to Owncloud to one tap. What's stopping me right now is the problem: Where do I rsync to? Webdav is the only recommended upload solution for OC besides sync clients/apps and the web interface. Owncloud's webdav share needs to be mounted somewhere in order to have a target to rsync to. We currently cannot mount the share on the phone itself, although we have davfs2 on Openrepos. It won't install on my Jolla because of a dependencies error (maybe NielDK can shed some more light on this issue). If you have a root server that is always on and is not your Owncloud server, it should be easy for you to mount the OC webdav share there and rsync your Jolla pics to it. However, I have only my OC machine with an open internet port, so I have to mount the webdav to that. It's not working for me though, so I was hoping you guys could help me work out the proper mount options for a share *on the server that it comes from*. I have unsolved threads here and here. I know this part is not exactly a Jolla/SailfishOS topic, but it's part of the procedure that we could use with the tools we have at our disposal already and post it on TJC as a wiki, once all the details are clear. If I succeed to mount the share on the OC server and the channel is open, the next step could be some sort of daemon that monitors the folder where the camera saves the pics, and triggers the rsync command whenever a picture is taken. Suggestions for this are welcome. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Just a suggestion: You could rip out the WebDAV implementation from Cargo Dock and use that. It shouldn't be too dependent on the UI, if at all.
https://github.com/pycage/cargodock/...api/davapi.cpp |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
http://talk.maemo.org/showpost.php?p...61&postcount=8 |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Maybe someone who does can try and take a look? |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
|
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
|
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
No need for any kind of GUI there. [*] actually I am of a mind that less GUI-tweaking you need to do, the smarter your device is... |
Re: (Automatic/one-tap) Photo upload to Owncloud
can you have services on the Jolla? I thought it wasn't possible due to API restrictions and wakelocks?
|
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
For example cron is one of most valuable things that I have in my device. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
|
Re: (Automatic/one-tap) Photo upload to Owncloud
1 Attachment(s)
Quote:
The main question though is, if I successfully install davfs on my Jolla, will that enable me to mount a Webdav share on the Jolla file system? |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
In any case, you also said that it's (at the moment?) not possible to rsync stuff to Owncloud through CargoDock. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Not so much to people who don't know how to code, set up a server etc., or let's just say the average smartphone user. I actually keep forgetting that the average smartphone user will also never be an Owncloud user... :p Me, I'm sort of somewhere inbetween these two categories, much closer to the latter one. So tell me, how do you "make it a service"? :confused: |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Fairly often there are cases that you have "both kinds work together" to make an useful functionality, for example the call recorder. It consists of 2 parts; one is a service always active and waiting for a call to happen and start recording, and the other is the user interface where you can change settings and listen to the recordings. So. How to make an application a service? The first requirement is that it needs to run headless, meaning it should not need to display anything on the GUI nor require any direct user input when it strts and runs. The next requirement is to launch it automatically, which on SFOS means it is started and stopped by systemd. The details for this are usually hidden in the installation RPM package (but of course you can also do it manually) In a simplified explanation; you create a small launcher script in /lib/systemd/system/ folder which tells what the service is and how to invoke it. There are quite a few service scripts there, you can look at them and see how they work. The beautiful thing about packaging in linux (whether it be RPM or DEB or whatever) is that it is easy to create functionality that uses both services and UI components and it installs (and uninstalls) pretty much automatically without any need for the user to understand what happens under the hood. :) |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Did you install my opened version from open reps? I will update my packages later this week |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
|
Re: (Automatic/one-tap) Photo upload to Owncloud
I just came across this thread and wanted to chime in.
I'm the main developer of the (yes, yes, unofficial) ownCloud client for SailfishOS. The client has been on the Jolla store for some time now but 2 months ago we got a nice little backup daemon running, which will be pushed to OpenRepos as soon as v0.3 is approved. I should have advertised this earlier, but oh well. So, if anybody is interested and can't wait until v0.3 hits the Jolla store (v0.3 is a pre-requisite for the daemon), you can grab the source from: https://github.com/beidl/harbour-owncloud Note that building and running installs both the app and the daemon on the phone. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
That means, that the syncing would have to be implemented without rsync. Anyway, uploading to OwnCloud with Cargo Dock is the same procedure as copying files locally. You have two panes. In one pane you open the source folder, in the other pane the destination folder (in this case on your OwnCloud). Tap and hold on a file in the source folder to get into selection mode and select what you want to upload. Then select "Copy" from the menu. For downloading, do the same, just vice versa. |
Re: (Automatic/one-tap) Photo upload to Owncloud
hmm
https://owncloud.org/faq/#rsync "Why does ownCloud use csync rather than rsync? rsync is a one-way syncing protocol. This means that if you have two servers and delete a file on one side, it will pop up again if you use rsync. To ensure old files get removed but new files added, and updated files overwritten, you need a N-to-N sync solution. ownCloud uses csync for syncing, which also deals with conflicts in a smart way." |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
(btw: man, I can' t believe you actually call yrself that as a dev name) |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
|
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Of course it would be even more awesome to have a real two-way sync client like on the desktop - that's what I count on beidl's Owncloud app to do at some point in the future, with the ability to choose which folders to sync. In this regard, I also sent you a question at openrepos whether you would consider porting the Unison command line to SFOS :-) I'd still be happy to know the answer, but we could make that a separate thread. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
This means I already can rsync to it just by launching the command in ShellEx with one tap, and without even needing admin prvileges on the server. Now for this part: Quote:
Any takers? |
Re: (Automatic/one-tap) Photo upload to Owncloud
Creating a service that monitors a folder and upload from that is easy.
This only takes a systemd service that executes a shell script using davfs to mount and upload any changes, no rocket science there. Will have a look at it later |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
This means that the process is launched when the device is booted up. The nice thing about that is that this doesn't require the app to be running in the background. The process watches for changes in ~/Pictures and uploads new files to a directory on the remote ownCloud instance (/Jolla/) when on WIFI. Using the ownCloud app you can set credentials and the daemon will pick those settings. (yeah, I know, I know. it's only funny when nobody has a clue what it means.... oida.) |
Re: (Automatic/one-tap) Photo upload to Owncloud
i want to use the auto sync with my owncloud server
- i install owncloud client from jolla store - setup it right and can connect to my server - i install than the ownCloud photo backup daemon - than i activate the option in owncloud client "Camera photo backups" - but nothing happend... i restart my phone, but this donst help too :( do i need to setup a other setting? or do i have creat a folder on my owncloud server? Phone is connected over wlan! |
Re: (Automatic/one-tap) Photo upload to Owncloud
can't login anymore, saying wrong user/pwd :(
Even without daemon installed http://reho.st/medium/self/f34ae9171...52a830265a.jpg |
Re: (Automatic/one-tap) Photo upload to Owncloud
You might want to try the newest versions of both the app and the daemon from OpenRepos.
I'll push a new version of the app to the Jolla store as soon as I get reports that the issues are fixed. Also, the daemon creates the folder automatically, nothing special you'd have to set up. Only make sure that you enabled the daemon from within the app's settings. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
I just produced a heap of duplicates of about half the files in my Owncloud through a botched sync client setup - I'll test the daemon as soon I know that's not going to happen here. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
It would just upload your local ~/Pictures directory to the remote /Jolla directory. In case a remote file has the same name/relative path locally we assume that it was uploaded by the backup daemon and don't overwrite it. After all, you usually don't edit pictures on the phone, when you "edit" them via the Gallery app it creates a new file and thats it. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Thanks for this daemon - it's very useful. Is there currently any way to configure the daemon, or do you plan to add any? I'd like to
- Enable/disable auto-upload - Restrict auto-upload to Wi-fi only, forbid in 2G networks, disable when roaming - Choose the owncloud folder to sync with |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
2) Already the case, upload only happens via WIFI 3) I could add UI to the settings for that, it certainly is easy to add. EDIT; Also, credit where credit is due: The initial daemon was provided by Sandsmark, I just fixed some issues like local->remote path matching, generally improving reliability, memory footprint and I keep on maintaining it. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
EDIT: Double checked the version of owncloud client I'm using and that is from Openrepo's. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Yes, there was a bug related to uploading via mobile connection but I fixed it. Care to do a bug report on GitHub and provide additional information? |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
Edit: Ok, I found logs under journalctl. I will attach those. |
Re: (Automatic/one-tap) Photo upload to Owncloud
Quote:
So that means that if a file with the same name is already present there, it won't be uploaded, but if e.g. I made subdirectories under /Jolla/Camera for each month and moved the photos in there, the daemon would assume that those files have not beem uploaded and do it again, yes? This is an unsolved problem for me also with the Rsync approach, I believe it can't tell either if a file is present in a subdirectory of its target. However, I'd really like to organize those pictures - just having this loooooonnnnnngggggggg, ever growing list is really stupid... Quote:
|
Re: (Automatic/one-tap) Photo upload to Owncloud
It came to my mind that if the photos were already organized into subfolders at the source location of Rsync command, we could leave that as it is at the target and keep maintaining identical copies.
That way, we can still upload via Rsync without getting duplicates (That won't work if I want the photos organised at my target location, but they're all in one folder on the Jolla.). I'm hoping that at some point the Jolla camera settings will include the option to automatically store all photos in subfolders by month. However, until Jolla does make something of the kind, I guess we can still make it work with the tools at hand. Surely there is a command (available on SailfishOS) that we could put together including some smart placeholders so that it'll always work with new files, moving everything into subfolders, one for each month? As you surely understand by now, I don't have the skill to do that, so maybe some of the pros here can lend a hand? |
All times are GMT. The time now is 06:40. |
vBulletin® Version 3.8.8