käsud,puhastamine, hooldus
Moderaator: Moderaatorid
http://en.wikipedia.org/wiki//dev/zeroHannus kirjutas:Huvi pärast küsiks, et siis mida too käsk teeb?
lastakse kogu su /dev/sda nullidega üle, nii et sinna ei jää miskit enam
Aa okay tänud. Aga teemasse, nt /home kausta koguneb alati mingit jama. Peamiselt siis erinevate aplikatsioonide config failid jms. Isegi sudo apt-get autoremove --purge'iga ei saa nendest lahti kahjuks (nt kui eemaldada vastava käsuga mõni programm). Kui keegi teaks vastavat käsku, oleksin väga tänulik. Mitte et väga raske oleks aegajalt seda puhastada, aga lihtsalt meeldiks selline linuxi tüüpi mõtlemine, et on võimalus kõik ära kustutada, mida pole vaja.
Ega need failid seal mingit ruumi küll ei võta, aga lihtsalt tekib sinna igast jama.
Ega need failid seal mingit ruumi küll ei võta, aga lihtsalt tekib sinna igast jama.
Mingit erilist vahendit pole puhastamiseks ilmselt tarvis, üldjuhul peaks piisama väiksest skriptijupist.Mõnel distrol on tmpwatch või mõni sarnase funktsiooniga skript juba olemas crontabis ja puhastab tmp kausta.Uuri /etc/cron.* kaustu, sealt võid selle leida ja lisa omale sobivad read, et su kodukausta ka puhastataks.
Näiteks üks selline:
See skript võtab oma konfi failist /ets/sysconfig/cron, mis näeb välja selline:
Säti aga parameetrid omale sobivaks ja anna tuld.Võid crontabiga ka tmpwatch käima sättida.
Näiteks üks selline:
Kood: Vali kõik
#!/bin/sh
#
#
# clean_tmp. This script was split off cron.daily
# Please add your local changes to cron.daily.local
# since this file will be overwritten, when updating your system.
#
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
#
# please send bugfixes or comments to http://www.suse.de/feedback.
#
# Author: Burchard Steinbild, 1996
# Florian La Roche, 1996
#
#
# paranoia settings
#
umask 022
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
#
# get information from /etc/sysconfig
#
if [ -f /etc/sysconfig/cron ] ; then
. /etc/sysconfig/cron
fi
#
# Delete apropriate files in tmp directories.
#
OMIT=""
for i in $OWNER_TO_KEEP_IN_TMP ; do
OMIT="$OMIT ( ! -user $i )"
done
function cleanup_tmp
{
MAX_DAYS=$1
shift
DIRS_TO_CLEAR="$@"
if [ "$MAX_DAYS" -gt 0 ]; then
for DIR in $DIRS_TO_CLEAR ; do
test -x /usr/bin/safe-rm && {
find $DIR/. $OMIT ! -type d ! -type s ! -type p \
-atime +$MAX_DAYS -exec /usr/bin/safe-rm {} \;
} || echo "Error: Can not find /usr/bin/safe-rm"
find $DIR/. -depth -mindepth 1 $OMIT -type d -empty \
-mtime +$MAX_DAYS -exec /usr/bin/safe-rmdir {} \;
done
fi
}
cleanup_tmp ${MAX_DAYS_IN_TMP:-0} ${TMP_DIRS_TO_CLEAR:-/tmp}
cleanup_tmp ${MAX_DAYS_IN_LONG_TMP:-0} ${LONG_TMP_DIRS_TO_CLEAR}
exit 0Kood: Vali kõik
## Path: System/Cron/Man
## Description: cron configuration for man utility
## Type: yesno
## Default: yes
#
# Should mandb and whatis be recreated by cron.daily ("yes" or "no")
#
REINIT_MANDB=yes
## Type: yesno
## Default: yes
#
# Should old preformatted man pages (in /var/cache/man) be deleted? (yes/no)
#
DELETE_OLD_CATMAN=yes
## Type: integer
## Default: 7
#
# How long should old preformatted man pages be kept before deletion? (days)
#
CATMAN_ATIME=7
## Path: System/Cron
## Description: days to keep old files in tmp-dirs, 0 to disable
## Type: integer
## Default: 0
## Config:
#
# cron.daily can check for old files in tmp-dirs. It will delete all files
# not accessed for more than MAX_DAYS_IN_TMP. If MAX_DAYS_IN_TMP is not set
# or set to 0, this feature will be disabled.
#
MAX_DAYS_IN_TMP="0"
## Type: integer
## Default: 0
#
# see MAX_DAYS_IN_TMP. This allows to specify another frequency for
# a second set of directories.
#
MAX_DAYS_IN_LONG_TMP="0"
## Type: string
## Default: "/tmp"
#
# This variable contains a list of directories, in which old files are to
# be searched and deleted. The frequency is determined by MAX_DAYS_IN_TMP
#
TMP_DIRS_TO_CLEAR="/tmp"
## Type: string
## Default: ""
#
# This variable contains a list of directories, in which old files are to
# be searched and deleted. The frequency is determined by MAX_DAYS_IN_LONG_TMP
# If cleaning of /var/tmp is wanted add it here.
#
LONG_TMP_DIRS_TO_CLEAR=""
## Type: string
## Default: root
#
# In OWNER_TO_KEEP_IN_TMP, you can specify, whose files shall not be deleted.
#
OWNER_TO_KEEP_IN_TMP="root"
## Type: string
## Default: no
#
# "Set this to "yes" to entirely remove (rm -rf) all files and subdirectories
# from the temporary directories defined in TMP_DIRS_TO_CLEAR on bootup.
# Please note, that this feature ignores OWNER_TO_KEEP_IN_TMP - all files will
# be removed without exception."
#
# If this is set to a list of directories (i.e. starts with a "/"), these
# directories will be cleared instead of those listed in TMP_DIRS_TO_CLEAR.
# This can be used to clear directories at boot as well as clearing unused
# files out of other directories.
#
CLEAR_TMP_DIRS_AT_BOOTUP="no"
# Type: time (eg: 14:00)
# Default: nothing
#
# At which time cron.daily should start. Default is 15 minutes after booting
# the system. Due to the fact that cron script runs only every 15 minutes,
# it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time
# you set.
DAILY_TIME=""
# Type: integer (days)
# Default: 5
#
# Maximum days not running when using a fixed time set in DAILY_TIME.
# 0 to skip this. This is for users who will power off their system.
#
# There is a fixed max. of 14 days set, if you want to override this
# change MAX_NOT_RUN_FORCE in /usr/lib/cron/run-crons
MAX_NOT_RUN="5"
## Type: yesno
## Default: no
#
# send status email even if all scripts in
# cron.{hourly,daily,weekly,monthly}
# returned without error? (yes/no)
#
SEND_MAIL_ON_NO_ERROR="no"
## Type: yesno
## Default: no
#
# generate syslog message for all scripts in
# cron.{hourly,daily,weekly,monthly}
# even if they haven't returned an error? (yes/no)
#
SYSLOG_ON_NO_ERROR="no"Ma kasutan seda siis, ei viitsi koguaeg neid käske eraldi toksida.
http://www.upload.ee/files/200642/cleaner.sh.html
http://www.upload.ee/files/200642/cleaner.sh.html
Kas nii ka mitte?obundra kirjutas:Kas asi on minus või on see link vigane?Igatahes alla laetud saan vaid upload.ee lehekülje html koodi.
http://www.upload.ee/download/200642/3d ... cleaner.sh
paar asja veel millega saab debianilisi liigsest kraamist vabaneda.
Esiteks localepurge, mille abil on võimalik vabaneda ebavajalikest keelepakettidest.
deborphan ja kui soov on graafiliselt teha suus gtkorphan.
puhastab süsteemi üksikuks jäänud pakettidest.
kolmandaks synapticu abil saab eemaldada jäänukid Residual config.
Esiteks localepurge, mille abil on võimalik vabaneda ebavajalikest keelepakettidest.
deborphan ja kui soov on graafiliselt teha suus gtkorphan.
puhastab süsteemi üksikuks jäänud pakettidest.
kolmandaks synapticu abil saab eemaldada jäänukid Residual config.
Pikemalt võib lugeda siit:
Cleaning up a Ubuntu GNU/Linux system
Cleaning up a Ubuntu GNU/Linux system






