Discussion:
[rsnapshot-discuss] passing interval when calling cmd_postexec?
dev
2016-09-21 14:30:20 UTC
Permalink
I have a cmd_postexec script which needs to know the interval which
rsnapshot was originally executed with. Is there a way to find this in
the cmd_postexec environment, or perhaps get rsnapshot to pass this
parameter along to cmd_postexec?

------------------------------------------------------------------------------
Gabriel Davini
2016-09-23 13:45:56 UTC
Permalink
Post by dev
I have a cmd_postexec script which needs to know the interval which
rsnapshot was originally executed with. Is there a way to find this in
the cmd_postexec environment, or perhaps get rsnapshot to pass this
parameter along to cmd_postexec?
I don't think there's a way to do this within rsnapshot.

Better try a workaround in your crontab script.
--
Gabriel.
Nico Kadel-Garcia
2016-09-23 22:55:51 UTC
Permalink
On Fri, Sep 23, 2016 at 9:45 AM, Gabriel Davini
Post by Gabriel Davini
Post by dev
I have a cmd_postexec script which needs to know the interval which
rsnapshot was originally executed with. Is there a way to find this in
the cmd_postexec environment, or perhaps get rsnapshot to pass this
parameter along to cmd_postexec?
I don't think there's a way to do this within rsnapshot.
Better try a workaround in your crontab script.
Why can't cmd_postexec be programmed with a perl function populated by
the rsnapshot run?

------------------------------------------------------------------------------
Gabriel Davini
2016-09-26 17:08:01 UTC
Permalink
Post by Nico Kadel-Garcia
Why can't cmd_postexec be programmed with a perl function populated by
the rsnapshot run?
I don't know, I've never done that. Waht I do know is that you can't easily
do
this from within rsnapshot.

But you can have several config files, each one with a different interval,
and
let the post exec script receive the interval as a fix argument passed
through the config file.
--
Gabriel.
Scott Hess
2016-09-26 17:35:28 UTC
Permalink
On Mon, Sep 26, 2016 at 10:08 AM, Gabriel Davini <
Post by Gabriel Davini
Post by Nico Kadel-Garcia
Why can't cmd_postexec be programmed with a perl function populated by
the rsnapshot run?
I don't know, I've never done that. Waht I do know is that you can't
easily do
this from within rsnapshot.
But you can have several config files, each one with a different interval,
and
let the post exec script receive the interval as a fix argument passed
through the config file.
Easier than multiple config files would be to have the cron entry add it to
your environment, like:

0 * * * * INTERVAL=hourly /usr/bin/rsnapshot hourly

IMHO pushing the interval into the environment wouldn't be too hard for
someone to add to rsnapshot.

-scott
Ken Woods
2016-09-26 17:35:54 UTC
Permalink
You're complicating it too much.
How many servers are you doing this for?
Post by Nico Kadel-Garcia
Why can't cmd_postexec be programmed with a perl function populated by
the rsnapshot run?
I don't know, I've never done that. Waht I do know is that you can't easily do
this from within rsnapshot.
But you can have several config files, each one with a different interval, and
let the post exec script receive the interval as a fix argument passed through the config file.
--
Gabriel.
------------------------------------------------------------------------------
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
dev
2016-09-27 16:05:12 UTC
Permalink
Post by Nico Kadel-Garcia
On Fri, Sep 23, 2016 at 9:45 AM, Gabriel Davini
Post by Gabriel Davini
Post by dev
I have a cmd_postexec script which needs to know the interval which
rsnapshot was originally executed with. Is there a way to find this in
the cmd_postexec environment, or perhaps get rsnapshot to pass this
parameter along to cmd_postexec?
I don't think there's a way to do this within rsnapshot.
Better try a workaround in your crontab script.
Why can't cmd_postexec be programmed with a perl function populated by
the rsnapshot run?
I didn't know this before. The man page states cmd_postexec does not get
executed for rotations (weekly, monthly) so question is moot.

------------------------------------------------------------------------------
Loading...