Re: shell wrapper to set ioctls before & after a command execution?

Robert Goley <[email protected]>
Newsgroups gmane.linux.debian.ports.amd64
Message-ID <CA+qYeyqsztH6SpcQqM1Rz8EwsYbJpBkUJ5-8vADgegsJTj=aKg@mail.gmail.com>
Wasn't sure it had been thought out.  Thought you were doing a single
backup script expecting blacklisting the single PID to work.  The method
you have should work great.


On Thu, Jun 6, 2013 at 12:55 PM, Giacomo Mulas
<[email protected]>wrote:

> On Thu, 6 Jun 2013, Robert Goley wrote:
>
>  That sounds like a good idea but you would need to blacklist the PIDs of
>> the
>> commands called from your backup script as well.  Most likely, they are
>> the
>> processes opening all of the files to start with.  You might want to look
>> at
>> using a python script for your backup script so you can more easily
>> capture
>> the PIDs of the executed commands.
>>
>
> Actually, I use backuppc, which in turn just uses rsync (with a lot of
> options). So it just gets down to substituting vanilla rsync with a wrapped
> rsync. But in general, yes, you are completely right. So far, I came up
> with
> this (generic) wrapper script:
>
> #! /bin/bash
> CACHEDEVICES="/dev/mapper/**capitanatacache"
>
> $* &
>
> mypid=$!
>
> for dev in ${CACHEDEVICES} ; do flashcache_setioctl -a -b ${mypid} ${dev}
> ; done
> wait ${mypid}
> exitcode=$?
> for dev in ${CACHEDEVICES} ; do flashcache_setioctl -r -b ${mypid} ${dev}
> ; done
>
> exit ${exitcode}
>
> Now I have to implement it through my updatedb (and similar) cron jobs, and
> my backup system.
>
> Ciao
>
> Giacomo
>
> --
> ______________________________**______________________________**_____
>
> Giacomo Mulas <[email protected]>
> ______________________________**______________________________**_____
>
> OSSERVATORIO ASTRONOMICO DI CAGLIARI
> Str. 54, Loc. Poggio dei Pini * 09012 Capoterra (CA)
>
> Tel. (OAC): +39 070 71180 248     Fax : +39 070 71180 222
> Tel. (UNICA): +39 070 675 4916
> ______________________________**______________________________**_____
>
> "When the storms are raging around you, stay right where you are"
>                          (Freddy Mercury)
> ______________________________**______________________________**_____
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.