OcLaunch Launch automagically

A complete example with Tarsnap

Version: 0.2.x

So you have installed OcLaunch. It is in your bashrc and works properly.

What to do now? In this document, we will explain a basic example.

Daily backup with Tarsnap

This software allows you to backup efficiently and securely on remote servers

Imagine you want to backup a directory before working on it. This directory may contain text documents, for instance.

You could create a cron job but that's quite complicated and you want to be sure to have a backup before start to work (you can't know what will append...).
This is a perfect job for oclaunch.

We assume that your backup command is

tarsnap -c -f $(hostname -s)-$(date -u +%Y%m%d-%H%M%S) <directory>

That's said, any other one is okay.

So you add your backup command to your ~/.oclaunch_rc.json with -a command like this:

 $ echo “tarsnap -c -f $(hostname -s)-$(date -u +%Y%m%d-%H%M%S) <directory>| oclaunch -a

And that's all.

Because oclaunch is in your .bashrc, it will be called each time you open a terminal, when the backup command is called one time (the first one).

You may also add it (oclaunch) to your session autostart, if you do not open terminals enough.

Want to simulate a computer restart?

Do you want to do a backup in the middle of a computer session?

Simply run

oclaunch -r

And oclaunch will behave as if you had restart !

You can also run a command from number (starts at 0).
For example, instead of running your long backup command, enter:

oclaunch 0

(You can get the number with oclaunch -l).

To be continued...

More ideas on this wiki page.

Feedback welcome at leowzukw@vmail.me