Post Script Permission Error (Urbackup + rclone)

Hi there. I’ve recently started going through the process of switching over my home server to a linux based system instead of a windows system, and decided to try out Urbackup for my backup solution. So far I’ve been quite enjoying the software.

However I’ve come across an issue that I cannot seem to solve. I want to use another program called rclone, to sync my backups to the cloud. So urbackup creates a backup from several clients in my home to the home server, and then rclone syncs that backup to the cloud for an off site redundancy.

I’d like to fully automate this process using the post script feature of urbackup, but no matter what I do, I seem to be getting an error.

Here is what I have:
Post script is located here: /var/urbackup/post_incr_filebackup
Post script contains the following code, which is all related to rclone:

rclone -L -v sync /mnt/SourceDirectory GDrive:/BACKUP/TargetDirectory

When I’ve tried an unscheduled incremental backup the following error comes up in the urbackup server log:

2018-02-28 21:02:27: ERROR: Script urbackup/post_incr_filebackup had error (code 32256)
2018-02-28 21:02:27: ERROR: Script output Line(1): sh: 1: urbackup/post_incr_filebackup: Permission denied
2018-02-28 21:02:30: ERROR: Backup failed

Now when I first installed rclone I noticed I couldn’t run it without sudo, and that’s because I was getting a permissions error on it’s config directory. It needed to create a tmp file there. However, I’ve tried adjusting the permissions of this directory in several ways, even going as far as to open it up to full 777 recursively, and the permission error persists.

I can run the above rclone command from a terminal just fine, even without sudo now, so the only thing I can think of is that urbackup itself doesn’t have permission to do something, but I’m not sure what. I’m still a little new to linux on the whole, so perhaps there is something about a program running another program that I’m not aware of.

If anyone has experience with using the post script feature of urbackup, I’d appreciate the input. Thanks.

This is your error message. Hence your urbackup/post_incr_filebackup is not executable. The urbackup user (usually named ‘urbackup’) should at least have read and execute rights.

If the owner of this file is urbackup (chown urbackup urbackup/post_incr_filebackup),

chmod 700 urbackup/post_incr_filebackup 

will be sufficient.

Or, if urbackup user shouldn’t have the right to change this file, you could do

chown root:urbackup urbackup/post_incr_filebackup
chmod 750 urbackup/post_incr_filebackup

BTW: chmod 777 is never a good idea, recursively … even more

Wow talk about a total oversight on my part. I never even thought to check the permissions on the script file itself. Thanks a lot! And don’t worry I only did 777 as a test, I made sure to put it back. Thanks again!