#842 Issue closed: mkbackup and ftp in CentOS 6

Labels: bug, fixed / solved / done

sergeymx opened issue at 2016-05-20 05:43:

( Sorry, bad my english )

  • Relax-and-Recover 1.17.2 / Git ( from repo EPEL )
  • CentOS release 6.7 (Final)
  • OUTPUT=ISO
    BACKUP=NETFS
    BACKUP_URL=ftp://mx@asu-test/rear/
  • rear -v mkbackup
    Relax-and-Recover 1.17.2 / Git
    Using log file: /var/log/rear/rear-centos6-build.log
    Creating disk layout
    Creating root filesystem layout
    TIP: To login as root via ssh you need to set up /root/.ssh/authorized_keys or SSH_ROOT_PASSWORD in your configuration file
    Copying files and directories
    Copying binaries and libraries
    Copying kernel modules
    Creating initramfs
    Making ISO image
    Wrote ISO image: /var/lib/rear/output/rear-centos6-build.iso (68M)
    Copying resulting files to ftp location
    Copying files '/var/lib/rear/output/rear-centos6-build.iso' to ftp location
    Password:
    removed /tmp/rear.Bc8HbPypf7fe4Pn/outputfs/centos6-build/.lockfile' removed directory:/tmp/rear.Bc8HbPypf7fe4Pn/outputfs/centos6-build'
    Encrypting disabled
    Creating tar archive '/tmp/rear.Bc8HbPypf7fe4Pn/outputfs/centos6-build/backup.tar.gz'
    Archived 1190 MiB [avg 3606 KiB/sec]OK
    Archived 1190 MiB in 339 seconds [avg 3595 KiB/sec]
  • lftp asu-test
    lftp asu-test:~> user mx
    Password:
    lftp mx@asu-test:/> cd rear
    lftp mx@asu-test:/rear> ls
    drwxr-xr-x 3 1301 1008 50 May 19 14:21 .
    drwxr-x--- 6 1301 0 48 May 19 13:17 ..
    -rw-r--r-- 1 1301 ftpgroup 71006208 May 20 05:32 rear-centos6-build.iso
  • Where to file : backup.tar.gz ?

Thanks.

gozora commented at 2016-05-20 08:38:

Hi,
Not sure your configuration directive BACKUP_URL=ftp://mx@asu-test/rear/ is correct.
According manual only following methods are supported:

BACKUP_URL=file://
BACKUP_URL=nfs://
BACKUP_URL=tape://
BACKUP_URL=cifs://
BACKUP_URL=usb://

sergeymx commented at 2016-05-20 09:38:

Hm. I did :

OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=iso://backup/
OUTPUT_URL=ftp://mx@asu-test/rear/

Its WORK. Thanks.
( Sorry did not validate the input path )

sergeymx commented at 2016-05-20 09:40:

Thaks.

jsmeix commented at 2016-05-20 09:59:

This is the reason:

When making the backup.tar.gz
backup/NETFS/default/10_mount_NETFS_path.sh
calls the mount_url function as

mount_url ftp://mx@asu-test/rear/

But in rear/lib/global-functions.sh the mount_url function is

mount_url() {
...
    case $(url_scheme $url) in
        (null|tape|file|rsync|fish|ftp|ftps|hftp|http|https|sftp)
            ### Don't need to mount anything for these
            return 0
            ;;

I.e. for BACKUP_URL=ftp://... nothing gets mounted
whereto the NETFS backup method would write
its backup.tar.gz so that the backup.tar.gz gets
created in the local rear working directory as
/tmp/rear.Bc8HbPypf7fe4Pn/outputfs/centos6-build/backup.tar.gz

This is just one more case where rear scripts
proceed "bona fide" without explicit checks
that everything is o.k.

I think rear scripts should be enhanced to better
check for unsupported values.

I think in this case the script
prep/NETFS/default/05_check_NETFS_requirements.sh
should be enhanced to check for actually
supported schemes in BACKUP_URL.

I will perpare a GitHub pull request...

sergeymx commented at 2016-05-20 10:11:

Thanks.
variant use : http://curlftpfs.sourceforge.net/

sergeymx commented at 2016-05-20 12:33:

Thanks.

Sorry you could not be in future versions to add method ftpfs for BACKUP_URL ?
( http://curlftpfs.sourceforge.net/ its locate more distribute linux )

gdha commented at 2016-05-20 13:14:

please create a service request (new issue on github) with your new feature
request

On Fri, May 20, 2016 at 2:34 PM, sergeymx notifications@github.com wrote:

Thanks.

Sorry you could not be in future versions to add method ftpfs for
BACKUP_URL ?
( http://curlftpfs.sourceforge.net/ its locate more distribute linux )


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/rear/rear/issues/842#issuecomment-220593679

jsmeix commented at 2016-05-23 08:08:

For completeness:
The feature request for 'ftpfs' as BACKUP_URL is https://github.com/rear/rear/issues/845

jsmeix commented at 2016-05-23 13:45:

With https://github.com/rear/rear/pull/843 this issue here
is considered to be fixed.

The feature about new/additional 'ftp' scheme
is done via https://github.com/rear/rear/issues/845

jsmeix commented at 2016-06-01 07:14:

Unfortunately https://github.com/rear/rear/pull/843 caused a regression,
see this user report on rear-users@lists.relax-and-recover.org
(excerpts)

Date: Tue, 31 May 2016 20:34:18 -0600
From: JB
...
Subject: [rear-users] making bootable ISO
...
when I run:
rear -v mkbackup
I get the following error message:
ERROR: Invalid scheme 'iso' in BACKUP_URL 'iso://backup'
(only nfs cifs usb tape file sshfs are valid)

It happened because neither the comments in
05_check_NETFS_requirements.sh
nor the documentstion list all valid schemes
cf. https://github.com/rear/rear/issues/842#issuecomment-220548557
and https://github.com/rear/rear/pull/843
but I missed https://github.com/rear/rear/issues/842#issuecomment-220561307 that shows that also an 'iso' scheme works.

jsmeix commented at 2016-06-01 07:33:

With https://github.com/rear/rear/pull/855
this above regression https://github.com/rear/rear/issues/842#issuecomment-222912051
is considered to be fixed.

To all rear users:

Currently only

nfs cifs usb tape file iso sshfs

are valid schemes for BACKUP_URL.

If you know about more (hidden) valid BACKUP_URL schemes
please report them here.

Many thanks in advance!

jsmeix commented at 2016-06-01 09:47:

For the fun of it:

In prep/RSYNC/default/10_check_rsync.sh I found:

#### OLD STYLE:
# BACKUP_URL=[USER@]HOST:PATH           # using ssh (no rsh)
#
# with rsync protocol PATH is a MODULE name defined in remote /etc/rsyncd.conf file
# BACKUP_URL=[USER@]HOST::PATH          # using rsync
# BACKUP_URL=rsync://[USER@]HOST[:PORT]/PATH    # using rsync (is not compatible with new style!!!)
#### NEW STYLE:
# BACKUP_URL=rsync://[USER@]HOST[:PORT]/PATH    # using ssh
# BACKUP_URL=rsync://[USER@]HOST[:PORT]::/PATH  # using rsync

Currently I don't know if those kind of BACKUP_URL
are affected by my test in 05_check_NETFS_requirements.sh

jsmeix commented at 2016-06-02 10:02:

FYI:

In usr/share/rear/output/default/95_copy_result_files.sh
I found (excerpts):

LogPrint "Copying resulting files to $scheme location"
case "$scheme" in
    (nfs|cifs|usb|file|sshfs|ftpfs|davfs)
    ...
    (fish|ftp|ftps|hftp|http|https|sftp)
    ...
    (rsync)
    ...
    (*) BugError "Support for $scheme is not implemented yet."
    ;;
esac

Perhaps this lists all currently supported schemes in rear.

I still did not investigate what of all those schemes
are affected by my "check for vaild BACKUP_URL schemes"
in 05_check_NETFS_requirements.sh where currently
only those schemes are vaild (for NETFS):

nfs cifs usb tape file iso sshfs ftpfs

Interestingly 'tape' is vaild in 05_check_NETFS_requirements.sh
but not listed in 95_copy_result_files.sh

Questions upon questions ...


[Export of Github issue for rear/rear.]