The script content
#! /bin/bash
echo "Dumping package List on: $SERVER"
/usr/bin/ssh -q -x -l root -o ConnectTimeout=10 $SERVER  dpkg --get-selections > /etc/dpkg.list
if [[ $? -ne 0 ]]; then
        ssh -q -x -l root -o ConnectTimeout=10 $SERVER  rpm -qa > /etc/dpkg.list
        if [[ $? -ne 0 ]]; then
        echo "Cannot connect to $SERVER"
the script is 777
and runs fine when I try through the console : executed under the backuppc user
I tried running is using:

/bin/bash /usr/local/BackupPC/customScripts/
Executing DumpPreUserCmd: /bin/bash /usr/local/BackupPC/customScripts/
Dumping package List on:
/usr/local/BackupPC/customScripts/ line 12: /etc/dpkg.list: Permission denied

Output from DumpPreUserCmd: /usr/local/BackupPC/customScripts/ line 12: /etc/dpkg.list: Permission denied
sudo /usr/local/BackupPC/customScripts/
Output from DumpPreUserCmd: Exec of sudo /usr/local/BackupPC/customScripts/ failed
2014-02-07 22:14:44 DumpPreUserCmd returned error status 256... exiting

Kind Regards Chris