Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /home/pbuc/public_html/forum/mods/ext_phorummail/ezc/Base/src/ezc_bootstrap.php on line 36

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; KeyCAPTCHA_CLASS has a deprecated constructor in /home/pbuc/public_html/forum/mods/keycaptcha/keycaptcha.php on line 108
DEST=/db_backup is not executable or cant be fou
Welcome! » Log In » Create A New Profile

DEST=/db_backup is not executable or cant be fou

Posted by Anonymous 
DEST=/db_backup is not executable or cant be fou
October 07, 2014 05:27AM
Hello,

I found these errors from rsnapshot:
[i]
[/i][b]        [/b][b]rsnapshot configtest[/b]
[quote]----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot configtest
----------------------------------------------------------------------------
ERROR: /etc/rsnapshot.conf on line 212:
ERROR: backup_script DEST=/db_backup && /bin/mkdir -m 700 -p $DEST &&
         /usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql
         localhost/unused - "DEST=/db_backup" is not executable or
         can't be found. Please use an absolute path.
ERROR: ---------------------------------------------------------------------
ERROR: Errors were found in /etc/rsnapshot.conf,
ERROR: rsnapshot can not continue. If you think an entry looks right, make
ERROR: sure you don't have spaces where only tabs should be.
[/quote] The problem is this following line in rsnapshot.conf:
[quote]backup_script   DEST=/db_backup && /bin/mkdir -m 700 -p $DEST && /usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql    localhost/unused
[/quote] My fix is:

        backup_script   /bin/true && DEST=/db_backup && /bin/mkdir -m 700 -p $DEST && /usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql       localhost/unused[i]
[/i][i][/i]
I do not like it because "/bin/true" really does not do anything.

Does anyone have a better solution on this issue?

Thanks,

LI Xin
DEST=/db_backup is not executable or cant be fou
October 07, 2014 07:23AM
On Oct 07 14:02, 李欣 (n3228 < at > ndensan.co.jp) wrote:

[quote]----------------------------------------------------------------------------
ERROR: /etc/rsnapshot.conf on line 212:
ERROR: backup_script DEST=/db_backup && /bin/mkdir -m 700 -p $DEST &&
/usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql
localhost/unused - "DEST=/db_backup" is not executable or
can't be found. Please use an absolute path.
ERROR:
---------------------------------------------------------------------
[/quote]
You are not supposed to do it like that. Have you read what rsnapshot
manual says about backup_script, including the examples?

Anyway, I think you should get by with simply this:

backup_script /usr/bin/mysqldump -r dbdump.sql some_db db_backup/

(in mysqldump --opt is on by default and -r is better than >)

If you really want to bypass the directory management features
of backup_script and just dump the database to a directory
of your own choosing before the backup, you should use
cmd_preexec instead.

In general though, if you want something more complex in the
backup_script, the recommended way is to put the commands in a
separate file and call that instead of trying to put a sequence of
shell commands directly in rsnapshot.conf.

Indeed that's the only documented way, so anything else is
unsupported and may break in a future version.

(The man page doesn't mention even options to the script,
even though actual code does take care of them properly.
Perhaps that should be fixed in the man page, as cases like
/usr/bin/mysqldump -r ... must be pretty common.
I would not, however, rely on shell operators like && and > to work,
even though they also actually do at present.)

If you insist on doing it the hard way, however:

[quote]My fix is:

backup_script /bin/true && DEST=/db_backup && /bin/mkdir -m
700 -p $DEST && /usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql
localhost/unused/
[/quote]
Ugh.

The most obvious fix is to forgo the variable DEST and instead write
the directory path twice, but that is also ugly.

You could call shell explicitly, but I'm not sure if that's
any better than using /bin/true:

backup_script /bin/sh -c 'DEST=/db_backup && /bin/mkdir -m
700 -p $DEST && /usr/bin/mysqldump some_db > $DEST/dbdump.sql'
localhost/unused/

Or you could get creative with shell features:

backup_script /usr/bin/mysqldump some_db > $(DEST=/db_backup &&
/bin/mkdir -m 700 -p $DEST && echo $DEST)/dbdump.sql'
localhost/unused/

But I really don't recommend doing things like that.
(NB: all of the above are untested, try at your own risk.)

Finally, you could of course patch rsnapshot to accept the syntax
you want, or ask for someone else to do it. I don't think it'd
gain much support, however.

--
Tapani Tarvainen

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
DEST=/db_backup is not executable or cant be fou
October 08, 2014 02:52AM
Hi Tapani,

Thanks for your reply.

I should make it more clear on what I am trying to do here,
because it does not make much sense in my last email.

1. Backup /var/ directory and mysql database for several servers.
2. Some servers need to backup locally, and some need to do it remotely.
3. I hope the local backup command and the remote backup command are as similar as possible

here is a part of my rsnapshot.conf:
[quote]# LOCALHOST
backup_script   /bin/true && DEST=/var/db_backup && /bin/mkdir -m 700 -p $DEST && /usr/bin/mysqldump -r $DEST/some_db.sql some_db       localhost/unused
backup  /       localhost/

# REMOTEHOST
backup_script   /usr/bin/ssh root < at > 192.168.0.2 ([email]root < at > 192.168.0.2[/email]) 'DEST=/var/db_backup && /bin/mkdir -m 700 -p $DEST && /usr/bin/mysqldump -r $DEST/some_db.sql some_db'    192.168.0.2/unused
backup  root < at > 192.168.0.2:/ ([email]root < at > 192.168.0.2:/[/email])      192.168.0.2_scp/
#backup rsync://192.168.0.2/some_server/        192.192.0.2_rsync/
[/quote] For database backup script,
I am considering writing a script to backup database like this:
[quote]# LOCALHOST
backup_script   /usr/local/bin/backup_db.sh -localhost       localhost/unused

# REMOTEHOST
backup_script   /usr/local/bin/backup_db.sh -remotehost 192.168.0.2      192.168.0.2/unused
[/quote] It seems like an overkill to me thought since all I need is to run 3, 4 commands.
Please let me know if anyone knows a better way to do it.

[quote]> If you really want to bypass the directory management features
[quote]of backup_script and just dump the database to a directory
of your own choosing before the backup, you should use
cmd_preexec instead.
[/quote][/quote] I would like to use directory management features as you suggested,
but I am not sure how to do it for remote server.
Can anyone help me on this one, please?

P.S. Thanks for your mysql tips. It really helps.

LI Xin

On 2014/10/07 16:21, Tapani Tarvainen wrote:

[quote] [quote]On Oct 07 14:02, 李欣 (n3228 < at > ndensan.co.jp ([email]n3228 < at > ndensan.co.jp[/email])) wrote:

[quote] ----------------------------------------------------------------------------
ERROR: /etc/rsnapshot.conf on line 212:
ERROR: backup_script DEST=/db_backup && /bin/mkdir -m 700 -p $DEST &&
/usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql
localhost/unused - "DEST=/db_backup" is not executable or
can't be found. Please use an absolute path.
ERROR:
---------------------------------------------------------------------
[/quote] You are not supposed to do it like that. Have you read what rsnapshot
manual says about backup_script, including the examples?

Anyway, I think you should get by with simply this:

backup_script /usr/bin/mysqldump -r dbdump.sql some_db db_backup/

(in mysqldump --opt is on by default and -r is better than >)

If you really want to bypass the directory management features
of backup_script and just dump the database to a directory
of your own choosing before the backup, you should use
cmd_preexec instead.

In general though, if you want something more complex in the
backup_script, the recommended way is to put the commands in a
separate file and call that instead of trying to put a sequence of
shell commands directly in rsnapshot.conf.

Indeed that's the only documented way, so anything else is
unsupported and may break in a future version.

(The man page doesn't mention even options to the script,
even though actual code does take care of them properly.
Perhaps that should be fixed in the man page, as cases like
/usr/bin/mysqldump -r ... must be pretty common.
I would not, however, rely on shell operators like && and > to work,
even though they also actually do at present.)

If you insist on doing it the hard way, however:

[quote]My fix is:

backup_script /bin/true && DEST=/db_backup && /bin/mkdir -m
700 -p $DEST && /usr/bin/mysqldump --opt some_db > $DEST/dbdump.sql
localhost/unused/
[/quote] Ugh.

The most obvious fix is to forgo the variable DEST and instead write
the directory path twice, but that is also ugly.

You could call shell explicitly, but I'm not sure if that's
any better than using /bin/true:

backup_script /bin/sh -c 'DEST=/db_backup && /bin/mkdir -m
700 -p $DEST && /usr/bin/mysqldump some_db > $DEST/dbdump.sql'
localhost/unused/

Or you could get creative with shell features:

backup_script /usr/bin/mysqldump some_db > $(DEST=/db_backup &&
/bin/mkdir -m 700 -p $DEST && echo $DEST)/dbdump.sql'
localhost/unused/

But I really don't recommend doing things like that.
(NB: all of the above are untested, try at your own risk.)

Finally, you could of course patch rsnapshot to accept the syntax
you want, or ask for someone else to do it. I don't think it'd
gain much support, however.

[/quote] [/quote]
DEST=/db_backup is not executable or cant be fou
October 08, 2014 11:40AM
On Oct 08 11:50, 李欣 (n3228 < at > ndensan.co.jp) wrote:

[quote]1. Backup /var/ directory and mysql database for several servers.
2. Some servers need to backup locally, and some need to do it remotely.
[/quote]
I'm not 100% sure I understand what you mean by "locally" here,
but I take it to mean the database lives in the same machine
where rsnapshot runs.

[quote]3. I hope the local backup command and the remote backup command are
as similar as possible
[/quote]
Understandable.

[quote]I would like to use directory management features as you suggested,
but I am not sure how to do it for remote server.
[/quote]
How about simply like this:

# LOCALHOST
backup_script /usr/bin/mysqldump some_db > some_db.sql local_db/

# REMOTEHOST
backup_script /usr/bin/ssh root < at > 192.168.0.2 '/usr/bin/mysqldump some_db' > some_db.sql remote_db/

(In the latter case -r would not work and I used > in the former
as well just to make them as similar as possible.)

--
Tapani Tarvainen

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
Sorry, only registered users may post in this forum.

Click here to login