Cronjob sichert nicht automatisiert auf FTP

Backup, Restore und Transfer von Daten
Post Reply
kai-behncke
Posts: 17
Joined: 2007-10-05 15:05
 

Cronjob sichert nicht automatisiert auf FTP

Post by kai-behncke »

Hallo liebes Forum,

ich habe ein Skript erstellt, um von meinem dezidierten Server auf meinen FTP-Backup-Server zu sichern.
Ich nutze Debian Etch.

Das Skript selbst läuft einwandfrei, wenn ich es manuell ausführe.

Das Skript z.B. so:

Code: Select all


ncftpput -u ******** -p ********* -DD -d /var/log/ncftpput/debug.txt -e /var/log/ncftpput/error.txt  backup.meinserver.de /kais_tarballs/dateien /home/tarballs/kais_promotionsordner_$DATUM.tar.gz
Allerdings, wenn das als cronjob läuft, dann werden immer nur Dateien ohne Inhalt auf dem FTP-Server angelegt.

Der cronjob sieht so aus:

Code: Select all


24  17  * * *    root   /etc/init.d/tarball_erstellen.sh
Kann es sein, dass innerhalb eines cronjob bestimmte Operationen nicht ausführen werden dürfen?
Kann es sein, dass der FTP Backup-Server so etwas registriert und blockt?

Danke im Voraus, Kai
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Cronjob sichert nicht automatisiert auf FTP

Post by Joe User »

Du nutzt relative Pfade und keine Shebang-Zeile, Beides ist in Cron-Scripten böse...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
kai-behncke
Posts: 17
Joined: 2007-10-05 15:05
 

Re: Cronjob sichert nicht automatisiert auf FTP

Post by kai-behncke »

Hallo Joe, vielen Dank erstmal. Das ist ja schon mal ein Ansatzpunkt.

Was ist denn eine Shebang-Zeile?
Wie sollte es denn in meinem Falle aussehen?

Danke nochmals, Kai
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Cronjob sichert nicht automatisiert auf FTP

Post by Joe User »

Code: Select all

#!/bin/bash

/usr/bin/ncftpput -u ******** -p ********* -DD -d /var/log/ncftpput/debug.txt -e /var/log/ncftpput/error.txt  backup.meinserver.de /kais_tarballs/dateien /home/tarballs/kais_promotionsordner_$DATUM.tar.gz
http://de.wikipedia.org/wiki/Shebang
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
kai-behncke
Posts: 17
Joined: 2007-10-05 15:05
 

Re: Cronjob sichert nicht automatisiert auf FTP

Post by kai-behncke »

Hi Joe User,
thank you again, wieder etwas gelernt.
Habe jetzt #!/bin/bash

in das Shellskript eingetragen. Habe auch den Versuch auf Kommandozeile

Code: Select all

/bin/bash /etc/init.d/tarball_erstelle.sh
abgeschickt und es lief prima durch, wird auch auf meinen FTP-Space gesichert dann.


Trotzdem: Wenn ich das als Cron-Job starte, dann funktioniert es nicht, es wird auf dem FTP-Server immer nur eine Datei angelegt, welche 20 Byte groß ist.
Hab gerade schon bei dem Provider angerufen, ob ein FTP-Backup per Cronjob generell möglich ist, die meinten, das sei gentlich kein Problem.

Du schriebst gerade ich würde relative Pfade nutzen? Wo denn da genau? Eigentlich sind die doch alle absolut?

Vielen Dank, Kai
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Cronjob sichert nicht automatisiert auf FTP

Post by Joe User »

Der Pfad zu ncftpput ist nicht absolut.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
kai-behncke
Posts: 17
Joined: 2007-10-05 15:05
 

Re: Cronjob sichert nicht automatisiert auf FTP

Post by kai-behncke »

Super, jetzt klappts.
Danke !!
Post Reply