Backup to FTP Server

Hi!

I today wanted to configure a FTP backup server.
It basically works, but I have problems with setting the path:

If I leave it empty, output is as follows:
August 10, 2016, 4:52 pm - data: Creating directory '/Daily_Full_Backup’
August 10, 2016, 4:52 pm - Directory ‘/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 4:52 pm - data: Directory ‘/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 4:52 pm - ftp_mkdir(): Create directory operation failed.
August 10, 2016, 4:52 pm - data: ftp_mkdir(): Create directory operation failed.

Strangely, it adds a ‘/’, so I think it is correct for the ftp server to deny creating /Daily_Full_Backup.
Then, I tried setting it to he full path, in my case /home/voip, but I get:

August 10, 2016, 4:48 pm - Creating directory 'home/voip/Daily_Full_Backup’
August 10, 2016, 4:48 pm - data: Creating directory 'home/voip/Daily_Full_Backup’
August 10, 2016, 4:48 pm - Directory ‘home/voip/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 4:48 pm - data: Directory ‘home/voip/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 4:48 pm - ftp_mkdir(): Create directory operation failed.
August 10, 2016, 4:48 pm - data: ftp_mkdir(): Create directory operation failed.

Again, strangely, it now removes the ‘/’, and I think the FTP server correctly denies to create.

So I created the folder daily_backup in the FTP home directory of user voip, and set the path to /daily_backup.
Now, the output is:
August 10, 2016, 5:03 pm - Creating directory 'daily_backup/Daily_Full_Backup’
August 10, 2016, 5:03 pm - data: Creating directory 'daily_backup/Daily_Full_Backup’
August 10, 2016, 5:03 pm - Directory ‘daily_backup/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 5:03 pm - data: Directory ‘daily_backup/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 5:03 pm - ftp_mkdir(): Create directory operation failed.
August 10, 2016, 5:03 pm - data: ftp_mkdir(): Create directory operation failed.

Has someone an idea what is wrong?

Thanks,
Stephan

Are you trying to FTP to the local disk? Or where is /home/voip/Daily_Full_Backup ? If it’s local then use the Local Storage

If you want to FTP to another server you need to set up the server on the PBX as well as create a user and grant permissions on the other server. I don’t bother using the path, the username and password gets the PBX to the right directory, and will create new sub directories based on the name of your backup

Hi!

It’s another Linux machine running an FTP server I want to store the backup to. I created the user ‘voip’, the home directory is present. From the FreePBX machine (named voip), I can ftp to the other Linux machine (schubert) without problem by hand:

[[email protected] ~]$ ftp schubert
Connected to schubert (192.168.0.1).
220 (vsFTPd 2.0.5)
Name (schubert:sbrauss): voip
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,0,1,208,91)
150 Here comes the directory listing.
drwx------ 2 1044 100 4096 Aug 10 14:25 Documents
drwxr-xr-x 2 1044 100 4096 Aug 10 14:25 bin
drwxr-xr-x 3 1044 100 4096 Aug 10 15:02 daily_backup
drwxr-xr-x 2 1044 100 4096 Aug 10 14:25 public_html
drwxr-xr-x 2 1044 100 4096 Aug 10 14:52 test
226 Directory send OK.
ftp> pwd
257 "/home/voip"
ftp>

So I get to the right directory. I also think that basically FreePBX can access the server, as the only error message I get is the failed mkdir.

Any idea?

Thanks
Stephan

I defined the FTP server in FreePBX like you did in your last email and added it also to the Storage Servers.

The full output I receive by email looks as follows:
August 10, 2016, 5:13 pm - data: Initializing Backup 3
August 10, 2016, 5:13 pm - Backup Lock acquired!
August 10, 2016, 5:13 pm - data: Backup Lock acquired!
August 10, 2016, 5:13 pm - Running pre-backup hooks…
August 10, 2016, 5:13 pm - data: Running pre-backup hooks…
August 10, 2016, 5:13 pm - data: Adding items…
August 10, 2016, 5:13 pm - Adding items…
August 10, 2016, 5:13 pm - Building manifest…
August 10, 2016, 5:13 pm - data: Building manifest…
August 10, 2016, 5:13 pm - Creating backup…
August 10, 2016, 5:13 pm - data: Creating backup…
August 10, 2016, 5:14 pm - Storing backup…
August 10, 2016, 5:14 pm - data: Storing backup…
August 10, 2016, 5:14 pm - Creating directory '/Daily_Full_Backup’
August 10, 2016, 5:14 pm - data: Creating directory '/Daily_Full_Backup’
August 10, 2016, 5:14 pm - Directory ‘/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 5:14 pm - data: Directory ‘/Daily_Full_Backup’ did not exist and we could not create it
August 10, 2016, 5:14 pm - ftp_mkdir(): Create directory operation failed.
August 10, 2016, 5:14 pm - data: ftp_mkdir(): Create directory operation failed.
August 10, 2016, 5:14 pm - Running post-backup hooks…
August 10, 2016, 5:14 pm - data: Running post-backup hooks…
August 10, 2016, 5:14 pm - Backup completed with errors!
August 10, 2016, 5:14 pm - data: Backup completed with errors!

Best regards,
Stephan

Addition: The log comes out this way when I leave path empty like you did.
It then wants to create “/Daily_Full_Backup”, but the FTP server denies this, as it is realive to the file system root.
I may could change this in the config of the FTP server, but why FreePBX adds the ‘/’?

I fixed my error by removing “/volume1” from my server address. Here was my initial error message that was confusing. FreePBX was trying to create a new Volume which of course it could not. After removing the /volume1 it worked perfectly. So my new path was /PBXact_Backup

Creating backup…
Storing backup…
Creating directory ‘/volume1/PBXact_Backup/POMPs_Full_Backup’
Directory ‘/volume1/PBXact_Backup/POMPs_Full_Backup’ did not exist and we could not create it
ftp_mkdir(): /volume1: Permission denied.