From: Barry Margolin on
In article
<64117ab5-06dd-4965-888d-def889fb236f(a)y18g2000pre.googlegroups.com>,
RexJacobus <rex.jacobus(a)gmail.com> wrote:

> I am not the Unix guy at my job. He left me a very simple change to
> do to the monthly backup before he went on holiday. I made the change
> but didn't put the correct permissions when I put it on the server so
> the monthly backup did not run over the weekend.
>
> I have reset the permissions. How can I run the monthly backup job
> manually. I don't want to mess with cron and if it doesn't work for
> some other reason I will need to run the copy I archived.

I typically deal with this in two ways:

1. Edit the crontab and set the time of the cron job to a couple of
minutes after now. Then when the cron job finishes, I edit the crontab
and put the time back to normal.

2. Use "crontab -l | grep monthly_backup", then cut and paste the
command line portion of the cron job into my shell.

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Kenny McCormack on
In article <barmar-192765.21323805052008(a)newsgroups.comcast.net>,
Barry Margolin <barmar(a)alum.mit.edu> wrote:
....
>> I have reset the permissions. How can I run the monthly backup job
>> manually. I don't want to mess with cron and if it doesn't work for
>> some other reason I will need to run the copy I archived.
>
>I typically deal with this in two ways:
>
>1. Edit the crontab and set the time of the cron job to a couple of
>minutes after now. Then when the cron job finishes, I edit the crontab
>and put the time back to normal.

I do this sort of thing, too - although it is safest to make a copy of
the line, set it to the time in the near future, let it run, then delete
that line. Note that the trick here is to avoid forgetting to delete
the line.

But as another poster noted, using "at now" is really the right way to
do this.

>2. Use "crontab -l | grep monthly_backup", then cut and paste the
>command line portion of the cron job into my shell.

The problem here is that cron runs things in a different environment
(env vars, etc) than your login shell (this fact is accountable for 95%
of the "But my program doesn't work in cron like it does at the command
line" posts that we see in newsgroups), so it isn't guaranteed that
running it from the command line will work the same as running it in
cron.