|
2012-02-04
, 02:22
|
Posts: 64 |
Thanked: 42 times |
Joined on Jun 2009
|
#2
|
|
2012-02-04
, 08:46
|
Posts: 188 |
Thanked: 90 times |
Joined on Sep 2006
|
#3
|
|
2012-02-04
, 10:09
|
Moderator |
Posts: 5,320 |
Thanked: 4,464 times |
Joined on Oct 2009
|
#4
|
Autosync apps w/o leaving background connections on (using cron job + gconftool-2)
http://talk.maemo.org/showthread.php?t=82089
|
2012-02-04
, 17:07
|
Posts: 188 |
Thanked: 90 times |
Joined on Sep 2006
|
#5
|
The Following User Says Thank You to aRTee For This Useful Post: | ||
|
2012-02-04
, 19:33
|
Posts: 104 |
Thanked: 58 times |
Joined on Dec 2011
|
#6
|
|
2012-02-04
, 20:13
|
Moderator |
Posts: 5,320 |
Thanked: 4,464 times |
Joined on Oct 2009
|
#7
|
|
2012-02-05
, 02:46
|
Posts: 24 |
Thanked: 27 times |
Joined on Nov 2010
@ Berkeley, CA
|
#8
|
Don't file another, just dig up the one or two that are already filed.
They're definitely there... There's been threads at TMO about it too.
We need everyone subscribed to and voting in the same report.
The Following User Says Thank You to jhwan For This Useful Post: | ||
|
2012-02-05
, 21:17
|
Posts: 188 |
Thanked: 90 times |
Joined on Sep 2006
|
#9
|
The Following User Says Thank You to aRTee For This Useful Post: | ||
|
2012-02-08
, 20:04
|
Posts: 64 |
Thanked: 42 times |
Joined on Jun 2009
|
#10
|
The Following User Says Thank You to zszabo For This Useful Post: | ||
But, allowing background connections all the time will drain the battery (at least more than necessary)... Especially, since you may just want to sync at home in the morning, and would (like my wife) not think of turning of the background connection - leading to it trying to find a known connection all day.
So, I figured out how to schedule the sync - in my case it's just CalDAV (gmail calendar).
I use cron (from this meego thread: http://forum.meego.com/showthread.ph...highlight=cron and this site: https://gitorious.org/cron-for-harmattan/cron ) and gconftool-2 to get the N9 to switch to "background connections allowed" temporarily, then set the CalDAV in "Accounts" to sync within that window.
Here's the script, which I put in /home/user/bin/synccal.sh:
And then as root, I setup cron:
to get started on that one; all you need to know in terms of vi commands is
i
<esc>
:w
:wq
:q!
Note that with the above lines, the device will have an internet connection at 6:10am plus about 10 secs, until 6:15:10.
I setup CalDAV to sync at 6:11, and the past few mornings, that worked fine.
And now for the weird thing....
if you look at my script, you'll see some commented out stuff, dbus command to actually sync the caldav calendar, plus some other debugging/logging stuff.
The dbus sync command:
manually sync your calendar
check /home/user/.sync/profiles/sync/log to see which number got synced, then use that number in the dbus sync command.
Works fine, as user, if you have a network connection.
As root, use the command as in the crontab, on the command line.
Works fine too, whoami nicely indicates that the owner of the process is clearly 'user'.
BUT! As cron job, this doesn't work...
I can't figure out why not - it actually does log the date and whoami output to the log file... but doesn't run the dbus command...
Any hints?