Script Bash en tâche cron -> erreur 255
... / Script Bash en tâche cron...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Script Bash en tâche cron -> erreur 255

by
NicolasG16
Created on 2021-11-12 20:30:01 (edited on 2024-09-04 13:15:29) in Tâches automatiques (cron)

Bonjour,
Je cherche à mettre en place un dump automatique de ma BDD sur un mutu. Mon script est le suivant :
> #!/bin/bash
> date=$(date +"%Y-%m-%d")
> umask 177
> mysqldump --user=xxxxxxx --password=yyyyyyy --host=xxxxxxxx.mysql.db --no-tablespaces xxxxxxx > /home/xxxxxxxx/www/_SQLBackup/Backup-$date.sql
> find /home/xxxxxx/www/_SQLBackup/* -mtime +21 -exec rm {} \;

Problème, ma tache CRON me sort une erreur à chaque fois (elle est bien paramétrée en langage "autre") :
> [2021-11-05 17:01:02] ## OVH ## END - 2021-11-05 17:01:02.274688 exitcode: 255
> [2021-11-05 18:01:02] ## OVH ## START - 2021-11-05 18:01:02.486260 executing: /homez.640/xxxxxxxx/Backup.sh
> [2021-11-05 18:01:02] Cannot execute command for user 'xxxxxxxx': Exec Format Error (err: -1)

Pourtant quand je teste la même chose en SSH, aucun problème, ma sauvegarde est bien créée.

Une idée du problème ?