PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > run cron manually
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

run cron manually

Réponse
 
LinkBack Outils de la discussion
Vieux 05/05/2008, 03h46   #1
RexJacobus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut run cron manually

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.

Rex
  Réponse avec citation
Vieux 05/05/2008, 05h03   #2
andrew
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: run cron manually

On 2008-05-05, RexJacobus <rex.jacobus@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.


The cron job would point to a script? You should be able to simply run
the script.

Andrew

--
http://www.andrews-corner.org
  Réponse avec citation
Vieux 05/05/2008, 05h46   #3
RexJacobus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: run cron manually

On May 5, 4:03 pm, andrew <and...@ilium.invalid> wrote:
> On 2008-05-05, RexJacobus <rex.jaco...@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.

>
> The cron job would point to a script? You should be able to simply run
> the script.
>
> Andrew
>
> --http://www.andrews-corner.org


The cron job runs monthly_save. When I go onto the server navigate to
\cron and type in 'monthly_save' it just says 'command not found'.
(if I type dir i can see it).

  Réponse avec citation
Vieux 05/05/2008, 08h00   #4
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: run cron manually

On 2008-05-05, RexJacobus <rex.jacobus@gmail.com> wrote:
>
>
> On May 5, 4:03 pm, andrew <and...@ilium.invalid> wrote:
>> On 2008-05-05, RexJacobus <rex.jaco...@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.

>>
>> The cron job would point to a script? You should be able to simply run
>> the script.
>>
>> Andrew
>>
>> --http://www.andrews-corner.org

>
> The cron job runs monthly_save. When I go onto the server navigate to
> \cron and type in 'monthly_save' it just says 'command not found'.
> (if I type dir i can see it).
>

If monthly_save is in the /cron directory, type ./monthly_save
  Réponse avec citation
Vieux 05/05/2008, 16h33   #5
Joachim Schmitz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: run cron manually

RexJacobus wrote:
> On May 5, 4:03 pm, andrew <and...@ilium.invalid> wrote:
>> On 2008-05-05, RexJacobus <rex.jaco...@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.

>>
>> The cron job would point to a script? You should be able to simply
>> run the script.
>>
>> Andrew
>>
>> --http://www.andrews-corner.org

>
> The cron job runs monthly_save. When I go onto the server navigate to
> \cron and type in 'monthly_save' it just says 'command not found'.
> (if I type dir i can see it).

in UNIX the current directory is not part of PATH. Inside cron it isn't
either, so you'd need to call it fully qualified, with an absolute
filename/one begining with /) or with a relative filename (relative to the
current directory), e.g. ./monthly_save.
Howvet to test it poiperly, use the 'at' command

at now /cron/monthly_save

That way the command should get exactly the same environment as if run by
cron.

Bye, Jojo


  Réponse avec citation
Vieux 06/05/2008, 14h42   #6
Kenny McCormack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: run cron manually

In article <barmar-192765.21323805052008@newsgroups.comcast.net>,
Barry Margolin <barmar@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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 14h08.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13378 seconds with 14 queries