The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-16-2008
Movomito Movomito is offline
Registered User
 

Join Date: Apr 2008
Posts: 25
Can is set permissions temporarily?

I want to do just what the title says. Here's why:

I am adapting a script that backups to a mount. In the script it has a catch where if the drive isn't RW then it unmounts and attempts to remount RW.

# attempt to remount the RW mount point as RW; else abort
$MOUNT -o remount,rw $MOUNT_DEVICE $SNAPSHOT_RW ;
if (( $? )); then
{
$ECHO "snapshot: could not remount $SNAPSHOT_RW readwrite";
exit;
}
fi;


I want to backup to another directory on the same drive, but i want that directories normal everyday permissions to be read only except for when i run the backup script. Is there a way to say "while this script runs apply these permissions to this directory? without simply chmoding at the front and backends of the script?

Suggestions are welcome.

Thanks,
Movomito
Reply With Quote
Forum Sponsor