Shell script qui ne fonctionne pas
Hall
-
Hall -
Hall -
Bonjour,
Voilà, j'ai un serveur dédié sous ovh sous centos 5.2
Dan le crontab je lui rajoute:
[code]
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
DATE=$(date +%d-%m-%Y-%H-%M)
57 10 * * * root tar -czvf /var/www/vhosts/portailinterim.com/httpdocs/piSources'date | awk '{printf $1$2$3}''.tar.gz /var/www/vhosts/portailinterim.com/httpdocs/* # marche
22 12 * * * root tar -czvf /var/www/vhosts/portailinterim.com/httpdocs/piSources'date | awk '{print daynum($1, $2, $3)}''.tar.gz /var/www/vhosts/portailinterim.com/httpdocs/* # ne marche
00 13 * * * root run-parts /etc/archivePi.sh # ne marche
05 13 * * * root /etc/archivePi.sh # ne marche
10 13 * * * root archivePi.sh # ne marche
28 11 * * * root tar -czvf /var/www/vhosts/vhosts/portailinterim.com/httpdocs/piSources'date +%d%m%y'.tar.gz /var/www/vhosts/portailinterim.com/httpdocs/* # marche
22 4 * * 0 root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
*/1 * * * * root /usr/local/rtm/bin/rtm 7 > /dev/null 2> /dev/null
/code
J'aimerai qu'il m'exécute le fichier archivePi.sh mais rien n'y fait ça ne marche pas
Voici ce que j'ai archivePi.sh:
[code]#!/bin/bash
# Script de sauvegarde des données située sur un serveur OVH
# Compression des données
cd /var/www/vhosts/site.com/httpdocs
tar -czvf /var/www/vhosts/site.com/httpdocs/piSources1.tar.gz /var/www/vhosts/site.com/httpdocs/*
/code
Je ne vois pas du tout ou ça coince... merci d'avance pour votre aide!
Voilà, j'ai un serveur dédié sous ovh sous centos 5.2
Dan le crontab je lui rajoute:
[code]
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
DATE=$(date +%d-%m-%Y-%H-%M)
57 10 * * * root tar -czvf /var/www/vhosts/portailinterim.com/httpdocs/piSources'date | awk '{printf $1$2$3}''.tar.gz /var/www/vhosts/portailinterim.com/httpdocs/* # marche
22 12 * * * root tar -czvf /var/www/vhosts/portailinterim.com/httpdocs/piSources'date | awk '{print daynum($1, $2, $3)}''.tar.gz /var/www/vhosts/portailinterim.com/httpdocs/* # ne marche
00 13 * * * root run-parts /etc/archivePi.sh # ne marche
05 13 * * * root /etc/archivePi.sh # ne marche
10 13 * * * root archivePi.sh # ne marche
28 11 * * * root tar -czvf /var/www/vhosts/vhosts/portailinterim.com/httpdocs/piSources'date +%d%m%y'.tar.gz /var/www/vhosts/portailinterim.com/httpdocs/* # marche
22 4 * * 0 root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
*/1 * * * * root /usr/local/rtm/bin/rtm 7 > /dev/null 2> /dev/null
/code
J'aimerai qu'il m'exécute le fichier archivePi.sh mais rien n'y fait ça ne marche pas
Voici ce que j'ai archivePi.sh:
[code]#!/bin/bash
# Script de sauvegarde des données située sur un serveur OVH
# Compression des données
cd /var/www/vhosts/site.com/httpdocs
tar -czvf /var/www/vhosts/site.com/httpdocs/piSources1.tar.gz /var/www/vhosts/site.com/httpdocs/*
/code
Je ne vois pas du tout ou ça coince... merci d'avance pour votre aide!
A voir également:
- Shell script qui ne fonctionne pas
- Classic shell - Télécharger - Personnalisation
- Script vidéo youtube - Guide
- Mas script - Accueil - Windows
- Ghost script - Télécharger - Polices de caractères
- Script cmd - Guide
6 réponses
Salut,
'date | awk '{print daynum($1, $2, $3)}''
C'est quoi ce truc? D'où ça sort ? Ça ne m'a pas l'air d'être une fonction intégrée de awk, si ?
;-((
'date | awk '{print daynum($1, $2, $3)}''
C'est quoi ce truc? D'où ça sort ? Ça ne m'a pas l'air d'être une fonction intégrée de awk, si ?
$ date | awk '{print daynum($1, $2, $3)}' awk: (FILENAME=- FNR=1) Fatal: fonction « daynum » non définie
;-((
oui ces deux scripts fonctionnent:
cd /var/www/vhosts/site.com/httpdocs
tar -czvf /var/www/vhosts/site.com/httpdocs/piSources1.tar.gz /var/www/vhosts/site.com
en utilisateur root
cd /var/www/vhosts/site.com/httpdocs
tar -czvf /var/www/vhosts/site.com/httpdocs/piSources1.tar.gz /var/www/vhosts/site.com
en utilisateur root
Ok.
Je réitère ma demande :
'date | awk '{print daynum($1, $2, $3)}''
C'est quoi ce truc? D'où ça sort ? Ça ne m'a pas l'air d'être une fonction intégrée de awk, si ?
Cette commande renvoie quoi chez toi ?
Ensuite, rajoute des traces dans tes crons :
Édit : Correction 2&>1 en 2>&1
Zen my nuggets ;-)
Je réitère ma demande :
'date | awk '{print daynum($1, $2, $3)}''
C'est quoi ce truc? D'où ça sort ? Ça ne m'a pas l'air d'être une fonction intégrée de awk, si ?
Cette commande renvoie quoi chez toi ?
Ensuite, rajoute des traces dans tes crons :
00 13 * * * root run-parts /etc/archivePi.sh >/tmp/fichier1.log 2>&1 05 13 * * * root /etc/archivePi.sh >/tmp/fichier2.log 2>&1 10 13 * * * root archivePi.sh >/tmp/fichier3.log 2>&1
Édit : Correction 2&>1 en 2>&1
Zen my nuggets ;-)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question