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.

ftp befehl zum dateien löschen

Empfohlene Antworten

Hi und hallo,

ich nutze ncftp um per Cronjob->Shellskript einen automatischen Login auf einem ftp-server durchzuführen, um eine Datei dorthin zu übertragen.

Das klappt auch perfekt.

Nun möchte ich aber gerne, da es sich um eine täglich Backupdatei handelt.

->Dateien auf dem ftp-Server, die älter als X Tage sind automatisch löschen.

Wie ist da der ftp Befehl dafür?

Vielen Dank

DEL ist der FTP Befehl.

Für das älter als X-Tage machst dir am besten ein Script, das mittels der date Funktion deine Dateinamen beschriftet.

hi, danke für die schnelle antwort, aber ich brauche ja noch was dahinter, das fetlegt, dass nur Dateien die älter als z.b. 30 Tage gelöscht werden sollen.

Analog zum Befehl in UNIX:

find [folder] -mtime +30 -exec rm {} \;

HOST='xxxxxxxxxxxxxxxxx.com'

USER='backup'

DELFILE=` date --date '-45 day' '+%Y%m%d'`"-blabla.sql.bz2"

PASSWD='*******'

FILE='/backup/datenbank/blabla.sql.bz2'

NEWFILE=` date +%Y%m%d-blabla.sql.bz2`

ftp -n $HOST <<END_SCRIPT

quote USER $USER

quote PASS $PASSWD

cd datenbank

put $FILE $NEWFILE

del $DELFILE

quit

Altes Script, musst dir selber umbauen, wirst schon zurechtkommen ;)

ok, ich danke dir! das hilft mir wirklich weiter.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.