Menu

uploaded no subfolders if execution with crontab

Janik Rabe
2015-10-12
2016-01-09
  • Janik Rabe

    Janik Rabe - 2015-10-12

    Deutsch / German:

    Hallo,
    ich habe mir ein kleines .sh Script geschrieben, welches ich später mit dem Crontab ausführe.

    In dem Script führe ich den Befehl so aus: „s3cmd put -r /opt/Backups/Backup_Xeon/* s3://backup-xeon/„ und möchte dass alle Ordner, inklusive aller Unterordner, aus …/Backup_Xeon/ in meinen S3 geladen werden.

    Führe ich das .sh Script manuell im Terminal aus, funktioniert es ohne Probleme, so wie es soll. Lasse ich nun aber exakt das gleiche Script vom Crontab ausführen, wird nur eine Ordnerebene, inklusive Dateien aus …/Backup_Xeon/ hochgeladen. Der Ordner, in dem Ordner, wird einfach ignoriert.

    Um es ein bisschen zu vereinfachen:

    So soll es hochgeladen werden: …/Backup_Xeon/Backup1/AndererOrdner/Dateien

    So wird es hochgeladen: …/Backup_Xeon/Backup1/Dateien

    Der Ordner „AndererOrdner“ und dessen Dateien, werden einfach ignoriert und das Script wird erfolgreich abgeschlossen. Es erscheint keine Fehlermeldung oder ähnlichem.

    Ich hoffe, ihr könnt mir helfen :)

    Gruß Janik


    Englisch / English:

    Hello there,
    I wrote myself a little .sh script that I run later with the crontab.

    In the script I run the command like this: "s3cmd put -r /opt/Backups/BackupXeon/ s3://backup-xeon/" and wants that all folders and subfolders, from .../Backup_Xeon/ in my S3 Loading.

    If I ascend the .sh script manually from the terminal, it works without any problems, as it should. I leave now but perform exactly the same script from crontab, only one folder level, including files from .../Backup_Xeon/ uploaded. The folder where the folder is, simply ignored.

    In order to simplify a bit:

    So it should be uploaded: .../Backup_Xeon/Backup1/otherfolders/files

    So it is uploaded: .../Backup_Xeon/Backup1/files

    The folder "otherfolders" and whose files are simply ignored and the script is completed successfully. No error message or the like.

    I hope you can help me :)

    Regards Janik

     
  • Matt Domsch

    Matt Domsch - 2016-01-09

    We often see differences running under cron due to environment variables (particularly LANG=) being different (or unset) under cron while set to something sane under a login shell. Try adding LANG=gb_DE (or your usual language) in your crontab to force this.

     

Log in to post a comment.