02-07-2011, 07:33 AM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jan 2011
Device: kindle 3
|
automatically sync remote directory to kindle on wlan0 up
hi all,
I asked this on the ##kindle irc channel but didn't get any feedback so i'll try here What I'm trying to do: When I switch the kindle on at home, i want it to rsync (over ssh) the contents of a remote folder to the kindle (fwiw, the remote folder holds daily news which calibre downloads for me every morning). My approach has been to add the following to my /etc/network/interfaces Code:
iface wlan0 inet dhcp # note post-up doesn't execute anything! up /mnt/us/local/bin/wlan0-up.sh I know the script is correct because it works fine when if I ssh into the kindle and run: /mnt/us/local/bin/wlan0-up.sh My 2 problems (I care a lot more about 2 than 1):
Code:
dbus-send --system /default com.lab126.wifid.cmConnected This is now really winding me up (!) as it shouldn't be this hard. anyone have any thoughts on it or otherwise managed to get the kindle to automatically sync from a remote folder? I currently have to ssh into it and run the script manually. Thanks! d Last edited by dent; 02-07-2011 at 07:35 AM. Reason: clarified a "doesn't work" statement |
02-07-2011, 01:12 PM | #2 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
ifup-called scripts might present you a different PATH environment setting than a login shell. Try qualifying the full paths to the executables you use in your script.
|
Advert | |
|
02-07-2011, 02:15 PM | #3 |
Addict
Posts: 219
Karma: 404
Join Date: Nov 2010
Device: Kindle 3G, Samsung SIII
|
Wouldn't it be simpler to run a small background script on your remote that would check periodically whether there the Kindle is up and sync when possible? I am actually doing exactly that. One advantage of this approach is that the syncing can be attempted as soon as the directory content changes, not just on the Kindle network start.
EDIT: to your problem 2: perhaps running in the background (& at the end of the command) could help? Last edited by janvanmaar; 02-07-2011 at 02:25 PM. |
02-07-2011, 03:38 PM | #4 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jan 2011
Device: kindle 3
|
thanks for the suggestions Jan,
I do use absolute paths in my scripts so it shouldn't be that. I'd also tried running the scripts in the background and that hadn't helped either. As to your suggestion, I'd prefer to initiate the sync from the kindle as the remote server is outside my nat'ed network and would require opening and forwarding ports which i'd rather not unless I have to. Especially as pulling from the kindle should be relatively simple thanks for the help though! |
05-17-2011, 10:03 AM | #5 | |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Device: kindle
|
Quote:
Actually, I was looking for a script that exactly does what yours does. Would you mind sharing yours with the community? Thanks in advance :-) |
|
Advert | |
|
05-17-2011, 06:06 PM | #6 |
Addict
Posts: 219
Karma: 404
Join Date: Nov 2010
Device: Kindle 3G, Samsung SIII
|
Hi elementz,
well, in the meantime, I am using a modified and significantly more complicated script (in fact a combination of 2 scripts) as I included fetching feeds via calibre in predefined times in it and syncing these particular feeds whenever needed rather than syncing a directory. I tried to find an old backup of the original directory syncing but I could not find it anymore... However, in case you are under Linux/Unix, it should be easy for me to write you a new script that does a simple directory syncing (if you do not mind that it wouldn't be tested and might need some modifications). A Windows (or multiplatform) or more robust solution would require more time and effort. |
05-19-2011, 06:50 AM | #7 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Device: kindle
|
Hey janvanmaar,
thank you very much for the kind offer! I am indeed on linux. What I am trying to do is actually the same as you are doing right now: fetching particular feeds, e.g. two times a day, and send them to the kindle as soon as it gets online. My main problem is that I simply don't know where to start when it comes to pushing the files to the kindle via wlan. What will I need to be running on the kindle? I guess I'll need to jailbreak first, and have some script running on the kindle to receive the files, right? Or can I simply install ssh, and login to the device over wireless and then push the files over a ssh connection? If you have your current script at hand, I guess that would be fine, I'd just need something that I can look at for reference. |
05-19-2011, 05:18 PM | #8 |
Addict
Posts: 219
Karma: 404
Join Date: Nov 2010
Device: Kindle 3G, Samsung SIII
|
Ah, I see. You'll need to install jailbreak and usbnetwork and setup usbnetwork for shared key ssh access to the Kindle (be careful there). The NiLuJe's README_FIRST.txt file from the usbnetwork package guides you through the process.
That's all needed on the Kindle's side. I am attaching my scripts that I use for automatic feeds downloading at specified times (using Calibre's command line tools) and syncing with the Kindle (using rsync). At the very least, you will need to adjust the settings (before the dashed "END OF INPUT" line) in both the scripts for your situation. I am simply having both the scripts sitting in /usr/local/bin/ and starting the kindle_fetch.py one at boot of the computer. |
05-20-2011, 03:22 AM | #9 | |
Enthusiast
Posts: 32
Karma: 1178
Join Date: Apr 2011
Device: Kindle 3
|
Quote:
I use Unison for synchronization. It slowly than rsync, but can two-side file-synchronization. |
|
05-20-2011, 06:21 AM | #10 |
Addict
Posts: 219
Karma: 404
Join Date: Nov 2010
Device: Kindle 3G, Samsung SIII
|
I actually prefer one-side synchronization only for the Kindle but Unison looks very interesting for other purposes - thanks for useful information!
|
05-20-2011, 09:26 AM | #11 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Device: kindle
|
janvanmmar, thx a lot! :-) Really looking forward to set this up, as soon as I have some spare time.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle Automatically Doubles Image Sizes | wallcraft | Amazon Kindle | 5 | 04-01-2011 11:59 AM |
Automatically Add Books to Calibre from Directory | pjd6896 | Calibre | 0 | 12-02-2010 09:15 PM |
Is there a way to have Calibre automatically sync my library with my Kindle DX? | St-Ambroise | Calibre | 1 | 09-05-2010 12:20 AM |
Remote Kindle Indexing on PC. | vugtitan | Amazon Kindle | 17 | 09-02-2010 05:17 PM |
Multicomputer Sync users - Do you sync the Config directory? | Starson17 | Calibre | 4 | 07-29-2010 01:07 AM |