Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo, ich habe mir ein Script geschrieben, dass von diversen Servern einige Dateien kopiert.

Das Skript läuft soweit, allerdings bekomme ich das nicht per cronjob gestartet.

Der Inhalt der crontab lautet :

# DO NOT EDIT THIS FILE - edit the master and reinstall.

# (/tmp/crontab.XXXXOty4z0 installed on Tue Jan 20 19:15:35 2009)

# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)

10 19 * * * sh /local/scripts/copy_notesini_ids.sh

16 19 * * * touch /local/notesdata/test.txt

Hinzugefügt habe ich die Einträge als root mittels crontab -e und am Ende der Datei noch eine Leere Zeile hinzugefügt. Auch der zweite Eintrag wird nicht ausgeführt. In /var/log/messages finde ich keine weiteren Informationen. Beim OS handelt es sich um ein SLES 10.

#!/bin/bash

#Linux Servers to access
LINUX_SERVERS="Server1
Server2
Server3
Server4
Server5"

# Target folder
TARGET=/local/notesdata

# Destination folder
DESTINATION=/local/notesdata/server_backups

#DOM_USER is the Linux account used to copy
USER=notes

#DATE
DATE=`/bin/date +%Y-%m-%d`

for machine in $LINUX_SERVERS

do
/bin/su - $USER -c "/usr/bin/scp $machine:$TARGET/notes.ini $DESTINATION/$machine-$DATE-notes.ini"
/bin/su - $USER -c "/usr/bin/scp $machine:$TARGET/$machine.id $DESTINATION/$machine-$DATE-$machine.id"

done

exit 0
[/PHP]

Bearbeitet von Notesfuzzi

Alternativ noch hier

  1. Nachschauen ob crond läuft
  2. Ausgaben in /var/log/cron.log sichten
  3. Hinter den Crontab-Eintrag das ">"-Symbol benutzen, um die Ausgabe in eine Datei zu lenken.
  4. Fehler aus Skript entfernen

Hier mal ne überarbeitete Version:


#!/bin/bash


#Linux Servers to access

LINUX_SERVERS="Server1

Server2

Server3

Server4

Server5"


# Target folder

TARGET=/local/notesdata


# Destination folder

DESTINATION=/local/notesdata/server_backups


#DOM_USER is the Linux account used to copy

USER=notes


#DATE

DATE=`/bin/date +%Y-%m-%d`


for machine in $LINUX_SERVERS;

do

        echo $machine

        `/bin/su - $USER -c "/usr/bin/scp $machine:$TARGET/notes.ini $DESTINATION/$machine-$DATE-notes.ini"`

        `/bin/su - $USER -c "/usr/bin/scp $machine:$TARGET/$machine.id $DESTINATION/$machine-$DATE-$machine.id"`

done;


exit 0

Bearbeitet von lupo49

Juhuuuuuu :)

Ich habe die crontab nach LadyPreis'Link mittels crontab /etc/crontab neu angelegt und danach funktionierte das.

Gern geschehen :bimei

Für die Zukunft: Cronjobs legt man eigtl. nicht als root an. Als normaler Benutzer "crontab -e" (an VISUAL-variable denken) reicht da völlig.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.