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 möchte aus einem entfernten Server eine datei per FTP runterladen.

Der Dateinamen lautet z.B. sicherung_2009_05_25.dat (sicherungsdatei vom 25.05.2009) nun soll diese Datei am 26. vom server geholt werden.

Dies soll aber per cronjob geschehen.

mein job für den gleichen tag(funktioniert auch) aber wie den Tag davor?


ftp -n xxx.xxx.xx.xxx << END_OF_FTP

user xxxx xxxxxxxxxxxx

cd /hagen/sicherung

lcd /home/hagen/sicherung

mget sicherung_vom_`date +\%Y`_`date +\%m`_`date +\%d`.*

bye

END_OF_FTP

Danke schonmal im vorraus.

Hier eine Lösung für die ksh:

#! /usr/bin/ksh


OFFSET=${1:-1}


case $OFFSET in

  *[!0-9]* | ???* | 3? | 29) print -u2 "Invalid input" ; exit 1;;

esac


eval `date "+day=%d; month=%m; year=%Y`

typeset -Z2 day month

typeset -Z4 year


# Subtract offset from day, if it goes below one use 'cal'

# to determine the number of days in the previous month.

day=$((day - OFFSET))

if (( day <= 0 )) ;then

  month=$((month - 1))

  if (( month == 0 )) ;then

    year=$((year - 1))

    month=12

  fi

  set -A days `cal $month $year`

  xday=${days[$(( ${#days[*]}-1 ))]}

  day=$((xday + day))

fi


print $year-$month-$day

print $month/$day/${year#??}

Quelle

hmmm... erstmal Danke für die schnelle Antwort.

Aber das ist mir nun zu viel.

Das wollte ich ja eigendlich vermeiden.

Ein programm oder ähnliches dazu zu schreiben.

Dann könnte ich auch ein .php script schreiben.

Aber trotzdem Danke

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.