emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Backuping org with git, cron and Dropbox
@ 2011-05-01  5:29 Marcelo de Moraes Serpa
  2011-05-01  5:36 ` Marcelo de Moraes Serpa
  0 siblings, 1 reply; 6+ messages in thread
From: Marcelo de Moraes Serpa @ 2011-05-01  5:29 UTC (permalink / raw)
  To: Org Mode

Hi list,

I just would like to share the approach I use (just finished setting
it up) to backup org.

I keep all my org files on ~/org/*. This is also a git repo. Every
night at 12:00AM, a cron job will run a sh script that will:

1) Commit with the current date ( Sat-30-04-2011-11:43:28 PM for example);
2) push to origin.

It's simpler than other solution such as backupninja (that I don't if
would work on dropbox) and keeps also a revision history (per day).

Here's the remote configuration for git.

  8 [remote "origin"]
  9   url = /Users/myname/Dropbox/org
 10   fetch = refs/heads/master:refs/heads/origin

Another thing I should point out is that I'm using (the excellent)
org-crypt to encrypt sensitive information such as bank accounts data
and passwords.

Also, I'm using TimeMachine to backup to an external hard-drive. Time
machine is not the most efficient of backup solutions but "just
works". I'll see if I can setup backupninja to backup to Dropbox as
well, if so, I might switch to that.

Hope might useful for someone out there :)

Cheers,

Marcelo.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Backuping org with git, cron and Dropbox
  2011-05-01  5:29 Backuping org with git, cron and Dropbox Marcelo de Moraes Serpa
@ 2011-05-01  5:36 ` Marcelo de Moraes Serpa
  2011-05-01 11:31   ` Bernt Hansen
  2011-05-02 17:16   ` theo
  0 siblings, 2 replies; 6+ messages in thread
From: Marcelo de Moraes Serpa @ 2011-05-01  5:36 UTC (permalink / raw)
  To: Org Mode

Another thing: I'm considering setting the commit cron job to every
hour. So, every hour I would have a fresh copy of org pushed to my
dropbox volume.

I forgot to share the commit.sh (I don't  usually program in bash, so
bear with me :)):

  1 DAYW=$(date | cut -d" " -f 1)
  2 NOW=$(date +"%d-%m-%Y-%r")
  3
  4 cd ~/org
  5 git add .
  6 git commit -a -m "$DAYW-$NOW"
  7 git push

Cheers,

Marcelo.

On Sun, May 1, 2011 at 12:29 AM, Marcelo de Moraes Serpa
<celoserpa@gmail.com> wrote:
> Hi list,
>
> I just would like to share the approach I use (just finished setting
> it up) to backup org.
>
> I keep all my org files on ~/org/*. This is also a git repo. Every
> night at 12:00AM, a cron job will run a sh script that will:
>
> 1) Commit with the current date ( Sat-30-04-2011-11:43:28 PM for example);
> 2) push to origin.
>
> It's simpler than other solution such as backupninja (that I don't if
> would work on dropbox) and keeps also a revision history (per day).
>
> Here's the remote configuration for git.
>
>  8 [remote "origin"]
>  9   url = /Users/myname/Dropbox/org
>  10   fetch = refs/heads/master:refs/heads/origin
>
> Another thing I should point out is that I'm using (the excellent)
> org-crypt to encrypt sensitive information such as bank accounts data
> and passwords.
>
> Also, I'm using TimeMachine to backup to an external hard-drive. Time
> machine is not the most efficient of backup solutions but "just
> works". I'll see if I can setup backupninja to backup to Dropbox as
> well, if so, I might switch to that.
>
> Hope might useful for someone out there :)
>
> Cheers,
>
> Marcelo.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Backuping org with git, cron and Dropbox
  2011-05-01  5:36 ` Marcelo de Moraes Serpa
@ 2011-05-01 11:31   ` Bernt Hansen
  2011-05-01 19:09     ` Marcelo de Moraes Serpa
  2011-05-02 17:16   ` theo
  1 sibling, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2011-05-01 11:31 UTC (permalink / raw)
  To: Marcelo de Moraes Serpa; +Cc: Org Mode

Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:

> Another thing: I'm considering setting the commit cron job to every
> hour. So, every hour I would have a fresh copy of org pushed to my
> dropbox volume.
>
> I forgot to share the commit.sh (I don't  usually program in bash, so
> bear with me :)):
>
>   1 DAYW=$(date | cut -d" " -f 1)
>   2 NOW=$(date +"%d-%m-%Y-%r")
>   3
>   4 cd ~/org
>   5 git add .
>   6 git commit -a -m "$DAYW-$NOW"
>   7 git push
>
> Cheers,

Hi Marcelo,

I use the following script hourly
http://doc.norang.ca/org-mode.html#OrgGitSyncSh
which also handles removing deleted files.

Regards,
Bernt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Backuping org with git, cron and Dropbox
  2011-05-01 11:31   ` Bernt Hansen
@ 2011-05-01 19:09     ` Marcelo de Moraes Serpa
  0 siblings, 0 replies; 6+ messages in thread
From: Marcelo de Moraes Serpa @ 2011-05-01 19:09 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Org Mode

Bernt,

That's amazing!

Much more complex, and I really liked the idea of tracking every
directory that has important files (including configuration files).
Thank you for sharing.

As for deleting files, I just rm -rf when I need to, so the next
commit -a will catch it.

But yours is definitely a new (and I'd say better) backup paradigm. I
will definitely implement your ideas later, but right now I'm
satisfied (kind of) OK with OSX's Time Machine.

Cheers,

Marcelo.


On Sun, May 1, 2011 at 6:31 AM, Bernt Hansen <bernt@norang.ca> wrote:
> Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:
>
>> Another thing: I'm considering setting the commit cron job to every
>> hour. So, every hour I would have a fresh copy of org pushed to my
>> dropbox volume.
>>
>> I forgot to share the commit.sh (I don't  usually program in bash, so
>> bear with me :)):
>>
>>   1 DAYW=$(date | cut -d" " -f 1)
>>   2 NOW=$(date +"%d-%m-%Y-%r")
>>   3
>>   4 cd ~/org
>>   5 git add .
>>   6 git commit -a -m "$DAYW-$NOW"
>>   7 git push
>>
>> Cheers,
>
> Hi Marcelo,
>
> I use the following script hourly
> http://doc.norang.ca/org-mode.html#OrgGitSyncSh
> which also handles removing deleted files.
>
> Regards,
> Bernt
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Backuping org with git, cron and Dropbox
  2011-05-01  5:36 ` Marcelo de Moraes Serpa
  2011-05-01 11:31   ` Bernt Hansen
@ 2011-05-02 17:16   ` theo
  2011-05-02 21:12     ` Marcelo de Moraes Serpa
  1 sibling, 1 reply; 6+ messages in thread
From: theo @ 2011-05-02 17:16 UTC (permalink / raw)
  To: Marcelo de Moraes Serpa; +Cc: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,


On 01/05/2011 07:36, Marcelo de Moraes Serpa wrote:
> 
>   1 DAYW=$(date | cut -d" " -f 1)
>   2 NOW=$(date +"%d-%m-%Y-%r")
>   [...]
>   6 git commit -a -m "$DAYW-$NOW"

Could be shorten :
   6 git commit -a -m "$(date +'%A-%F-%T')"

- -- 
Freeely,
theo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNvubRAAoJECkgngj8k9Tvn+UH/1wv5z7Z5sLjBMuxERkZlSsi
8yPGbRyg6TgVXUjNAseOSoDeYPfj83cz+DF1mX7A9xz1GPfW+M38lWyNR2ALFL75
0/V5X40Yz9RuLb06CoilVH7xUu7SEbTHbSEjjwnZIj6WeKAhalucWR0L0ZoWbE5K
54lxfrzm+VcVZI3eD1AuROjoEgf+OZFc24qFqEepeH6cVydUEuRnNXVVfIxq7XDN
IyF1wXkmqvWgX9FKuRY4XNM62z4UZBDj/Pwvt/vhJA64tK43d8By6N/vmwQJu3a+
iS0+xLPV2ud5t7bQ8Cz1nxQJ4lsBwBfJhQhIIfbWBeq+tULE5Fo+w/iixQn8UI8=
=GQrM
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Backuping org with git, cron and Dropbox
  2011-05-02 17:16   ` theo
@ 2011-05-02 21:12     ` Marcelo de Moraes Serpa
  0 siblings, 0 replies; 6+ messages in thread
From: Marcelo de Moraes Serpa @ 2011-05-02 21:12 UTC (permalink / raw)
  To: theo; +Cc: Org Mode

Hi Theo,

Thanks for the tip. I don't really program in bash, so that was a
useful tip. I'll start getting into it more, as it's a simple and
powerful way to solve problems, and it's available almost everywhere
you have a POSIX OS :)

Cheers,

Marcelo.

On Mon, May 2, 2011 at 12:16 PM, theo <theocrite@theocrite.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
>
> On 01/05/2011 07:36, Marcelo de Moraes Serpa wrote:
>>
>>   1 DAYW=$(date | cut -d" " -f 1)
>>   2 NOW=$(date +"%d-%m-%Y-%r")
>>   [...]
>>   6 git commit -a -m "$DAYW-$NOW"
>
> Could be shorten :
>   6 git commit -a -m "$(date +'%A-%F-%T')"
>
> - --
> Freeely,
> theo
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNvubRAAoJECkgngj8k9Tvn+UH/1wv5z7Z5sLjBMuxERkZlSsi
> 8yPGbRyg6TgVXUjNAseOSoDeYPfj83cz+DF1mX7A9xz1GPfW+M38lWyNR2ALFL75
> 0/V5X40Yz9RuLb06CoilVH7xUu7SEbTHbSEjjwnZIj6WeKAhalucWR0L0ZoWbE5K
> 54lxfrzm+VcVZI3eD1AuROjoEgf+OZFc24qFqEepeH6cVydUEuRnNXVVfIxq7XDN
> IyF1wXkmqvWgX9FKuRY4XNM62z4UZBDj/Pwvt/vhJA64tK43d8By6N/vmwQJu3a+
> iS0+xLPV2ud5t7bQ8Cz1nxQJ4lsBwBfJhQhIIfbWBeq+tULE5Fo+w/iixQn8UI8=
> =GQrM
> -----END PGP SIGNATURE-----
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-02 21:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-01  5:29 Backuping org with git, cron and Dropbox Marcelo de Moraes Serpa
2011-05-01  5:36 ` Marcelo de Moraes Serpa
2011-05-01 11:31   ` Bernt Hansen
2011-05-01 19:09     ` Marcelo de Moraes Serpa
2011-05-02 17:16   ` theo
2011-05-02 21:12     ` Marcelo de Moraes Serpa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).