maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   Initiate backup from commandline? (https://talk.maemo.org/showthread.php?t=90360)

pdey 2013-06-05 11:52

Initiate backup from commandline?
 
After just permanently losing all my SMSs and contacts, I've become super paranoid about the prospect of this happening again.

Does anyone know of a way to initiate the built-in backup from the commandline? I think it must be possible, because the PR1.2 and PR1.3 updates kicked off an auto-backup before they installed.

I'm hoping I can script it so cron/ProfileMatic kicks off a backup at 3am every morning...

juiceme 2013-06-06 05:51

Re: Initiate backup from commandline?
 
Interesting idea. When you invoke backup, ps shows these processes starting:
Code:

8341 user    /usr/bin/backup-framework
 8346 user    /usr/bin/invoker --type=m /usr/bin/backup-framework
 8358 user    /usr/bin/invoker --type=qt /usr/bin/fenix-backup
 8359 user    /usr/bin/as-backup
 8385 user    sh /usr/share/backup-framework/scripts/backup-essentials-tracker-backup.sh 14 contacts emails messaging organizer bookmarks settings applications tagged_files comm_and_cal images_and_documents music_and_videos other documents media
 8387 user    dbus-send --reply-timeout=2147483647 --print-reply --type=method_call--dest=org.freedesktop.Tracker1 /org/freedesktop/Tracker1/Backup org.freedesktop.Tracker1.Backup Save string file:///home/user/MyDocs/.tmp/trackerbackup
 8390 user    /usr/bin/fenix-backup

Maybe a script could be made that uses this...

pdey 2013-06-06 07:14

Re: Initiate backup from commandline?
 
I'd found /usr/bin/backup-framework, but without any arguments, it simply brings up the initiate backup interface.

Since I couldn't find any other binaries that alluded towards backup, I'm under the assumption that backup-framework probably takes an argument (e.g. something that specifies the name of the backup) to kick off an automated one.

The scripts in /usr/share/backup-framework/scripts is interesting. I'll have a dig and see what I can find.

Leinad 2013-06-06 08:45

Re: Initiate backup from commandline?
 
For SMS-backup, have a look at this thread: http://talk.maemo.org/showthread.php?t=83166

For contacts-backup i sync with Outlook / Nokia Suite regularly, so when they are gone, i just connect my phone to my PC and they are back again.

pichlo 2013-06-06 09:27

Re: Initiate backup from commandline?
 
You can also export contacts in a vcard file and import it back when you lose them. No PC needed. But that does not fit the OP's requirement. At best it changes the question from "how to run X in a cron job" to "how to run Y in a cron job".

Leinad 2013-06-06 09:35

Re: Initiate backup from commandline?
 
Well, it does not answer his exact question, but maybe it solves his problem until he has found an answer to his question...

rainisto 2013-06-06 11:20

Re: Initiate backup from commandline?
 
You can command/trigger backup-engine with dbus messages. Or you can just do script that uses the backup UI with xresponse-command. If I remember correctly you can install xresponse with apt-get install xresponse.

I might release my commandline backup/restore script someday.

pdey 2013-06-06 13:17

Re: Initiate backup from commandline?
 
Quote:

Originally Posted by rainisto (Post 1349947)
You can command/trigger backup-engine with dbus messages.

I did find the Harmattan SDK page about hooking into backup-framework via dbus when writing an app (http://harmattan-dev.nokia.com/docs/...Framework.html), but I couldn't find anything about triggering backup-framework itself from dbus.

wolke 2013-06-06 17:33

Re: Initiate backup from commandline?
 
i dont use the thick backup tool because:
1) its not configurable
2) you cant tell what it does so you dont know whats safely backed up
3) it backs up to a thick binary you cant read without the phone
4) its slow because it does the whole shebang every time {as opposed to incremental, where it only takes time if you added a lot of stuff}
5) theres no easy way to have it copy the backup over to your computer via wifi {because you dont get notified programmatically when its done}


instead, i invoke a series of scripts from my computer that backs data up efficiently in a human-readable format, and backs up the binary files i would cry if i lost {pictures, videos} with rsync.

it fires at 5am, and backs up DCIM, SMS, calls, contacts, qtodo notes, and my swype dictionary. it also syncs my pidgin logs, mydocs, and music, which i only change on my computer but like to have up-to-date on my phone.

as for installed programs, desktop background, camera sound file, gconf settings, terminal vkb, home icon positions, etc, i have an interesting model for making sure these are always backed up. i NEVER change these with the phone interfaces, and instead modify a set of config scripts stored in my git repo, and then re-run them.
{e.g.: when installing coderus' new qml firefox ui, i add 'qmlmozbrowser' to my package.pl script and invoke it from my laptop. it installs it, and then i commit my script.}

so if my phone got bricked and i had to reflash {or if it drowned in a hurricane}, i would just run my installation scripts, then run my backup-restore scripts, and have the precise same phone, except the **** that happened since 5am, like taking awesome pics of a hurricane drowning my house in seawater.

wolke 2013-06-06 17:36

Re: Initiate backup from commandline?
 
if you run linux, i can probably assist you in backing SMS, call log, and contacts in human-readable form on your laptop overnight via wifi.

pdey 2013-06-07 06:42

Re: Initiate backup from commandline?
 
OK, some success:

As you all probably know, the full backup initiated from the UI creates a bunch of zip files in ~/MyDocs/.backups/BackupX/

Misleadingly, the messages aren't actually stored in messaging.zip. It turns out almost everything I care about is in contacts.zip. There's a file called in contacts.zip under Root/home/user/MyDocs/.tmp called trackerbackup.

This SQLite database appears to hold all the contacts, SMS's, and as far as I can tell, even the calendar entries.

Creation of this file is triggered by the backup-framework invoking /usr/share/backup-framework/scripts/backup-essentials-tracker-backup.sh.

I still haven't figured out how to auto-invoke backup-framework itself, other than a string in the binary saying "Backup-Framework is launched from SSU, no UI update" (SSU being "Seamless Software Update" -- presumably such as a PR update). This indicates to me there *must* be some way to invoke it in SSU mode...somehow...

cuh7b5 2013-08-29 14:40

Re: Initiate backup from commandline?
 
I am really interested if you guys have some news in this area.

wolke, I would be pleased to use your backup/restore scripts if they really work. Could you share them with us?

wolke 2013-08-29 15:01

Re: Initiate backup from commandline?
 
lol, yes, they really work, my backup runs every single day @5am. my confidence in them is such that i am perfectly comfortable immediately flashing my phone after taking a backup.


here is my log from last night, with emails and phone numbers stripped out.
http://pastie.org/private/6wbfkycesnsgnv60hbhda

everything is in my git repo {the main script is backup-phone, and i run it, with no other args, every night}:
https://github.com/teleshoes/n9-config

wolke 2013-08-29 15:06

Re: Initiate backup from commandline?
 
now, the backup that runs nightly is only PART of what i do to make sure my phone is reflashable any time, though its the most important part.

i also use my git repo to track any and all configuration changes, by making the change directly in the repo and using my config scripts to make it happen on the phone.

check out this thread, where i describe in excruciating detail what i backup and what i restore, and how i no longer ever need to touch the phone to do all of it.

http://talk.maemo.org/showthread.php?t=91106

wolke 2013-08-29 15:11

Re: Initiate backup from commandline?
 
HOWEVER, i dont think just dumping this stuff on you will actually enable you to do it.

my repo is not intended as a release system for a piece of easy-to-use-software; it is my own personal solution and its customized for me. {of course, anyone is free to do just about anything they like with it, and nothing that i wrote is missing from my github}

if anyone is particularly interested, i can help you get set up doing some of the things i do, and would love doing it. i cant help you, though, unless you run linux, preferably debian {or linux mint or ubuntu etc}.


All times are GMT. The time now is 07:22.

vBulletin® Version 3.8.8