Hi Kushal,

Thanks for the assist.

On 24/05/2012 07:05 AM, Kushal Kumaran wrote:
If you use the N>  FILENAME syntax, the shell will create the file and
make descriptor N refer to the named file.  You don't have to create
the file yourself.  Details of this kind of redirection are in the
bash manual, if you're interested.

Thank you. In the usual context I would have expected the > to create the file. I just was not sure.

Just replace your backup command:

  /script/backup arg1 arg2

with:

  flock -xn /tmp/backup-lock /script/backup arg1 arg2

This query actually stemmed from my backup thread query (Automatic Backup Script Help), where I have a udev rule kick off the backup script.

In order to prevent the suspension of udev operations I intend to use a staging script, which originally read as follows...

/data/backups/scripts/start-disk-1.sh
#!/bin/bash
echo /data/backups/scripts/backup-disk-1.sh | at now + 1 minute

From your info, I guess I can now use...

/data/backups/scripts/start-disk-1.sh
#!/bin/bash
echo flock -xn /tmp/disk-1-lock /data/backups/scripts/backup-disk-1.sh | at now + 1 minute

Kindest Regards

Craig A. Adams


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4fbdc5ec.4070...@iafrica.com

Reply via email to