Quite likely you are going to do something that will hurt you in the future.
Maybe it's best not to use that script which does not seem to fit your task. Is it maybe easier to use e.g. rsync? (and that tool can also backup very efficiently over network, if desired. I do use it to (in place, incrementally) backup about 70 GB over a 1 mbit line)
[code]rsync /actual/data /backup/data --chmod=mode[/quote]
However:
That remount rw should not affect your running operations. A remount ro is likely to fail or hurt you - comment it out.
Quote:
The file system that i am backing up is huge and making it inaccessible to other users while the backup takes place is not really an option. So i would like to temporarily set the permissions to READ WRITE while the backup takes place
Which permissions? Those of the actual data!? Aren't they rw already?
Why do you want the backup'd data to be ro? First that's no real security, second it will prevent you from fast recovery in case of data loss.
If your script does not really care about permissions you can try to invoke umask (see man page) with some restrictive mask before running that script.