crontab priorities

I have a user that wants to run a backup of an oracle database via a file copy. They shut down the database once a week, and do a full copy. She wrote a script to do this for her, and it works, but when she runs it from cron, it takes twice as long. I took a look, and found a way to get it to run as though she is at the console, but it does not seem to work. I have an excerpt from the script. She said that she has used the set +o bgnice to make it not use a lower priority, but it still takes twice as long when she does it via cron rather than interactively at the console. Does anyone know how to change the priority of the cron job? We don't really want it to run under the root cron (I think that is why the bgnice does not work) because she then has no way to change the schedule if she needs to. She is running this with a user privilege account rather than an elevated account. What is the best way to deal with this? Is there perhaps a group that would allow this sort of thing? Thanks for the help.

#set +o bgnice

echo "Starting u01 Copy..."
#sh +o bgnice copy_dir.sh u01 $backupname &
sh copy_dir.sh u01 $backupname &

echo "Starting u02 Copy..."
#sh +o bgnice copy_dir.sh u02 $backupname &
sh copy_dir.sh u02 $backupname &

echo "Starting u03 Copy..."
#sh +o bgnice copy_dir.sh u03 $backupname &
sh copy_dir.sh u03 $backupname &

echo "Starting u04 Copy..."
#sh +o bgnice copy_dir.sh u04 $backupname &
sh copy_dir.sh u04 $backupname &

echo "Starting u05 Copy..."
#sh +o bgnice copy_dir.sh u05 $backupname &
sh copy_dir.sh u05 $backupname &

when she wrote the scripts she ran it one by one in console or in background one by one as defined crontab??

When she runs the backup manually, she is just running the same script from the same location. The only thing that is different is that one way is from Cron, and the other is by command line.

I don't know AIX but cron usually runs with nice 2 but this is controlled by the queuedefs file. Queues a, b, and c are for at, batch, and cron. I have never tried it, but you should be able to add a line for queue, say, o which defines a special queue and set the nice value to zero. Then you should be able to run the script from the console with "at -q o ...". If that works well put the "at" command in crontab. The "at" command itself will run with crons default priority, but it only takes a few seconds. Then the job it creates will run with whatever you set in the queuedefs file for queue o. I picked "o" for oracle, but you won't be able to stop other users from using queue o.

try adding these two lines in the begining of the script
#! bin/usr/sh
. $HOME/.profile

The problem was probably that the script was using relative paths to the $PWD to reference the files being copied. When run from cron, cron's default directory is "/" and I'm guessing the files aren't there. If she were to put a "cd /path/to/files" at the begining of the script, it would probably fix it. A better way to program it would be to use full path names to the files being copied and a full path to the destination.