־ ݾ ֽϴ.
ϰ ϴ ũƮ crontab? Ʋ ѹ ϵ صξϴ.
#!/bin/sh
#Variables
NOW=$(date +"%Y%m%d")
BKDIR="/home/user"
SVDIR="/bakup"
FILE="$NOW.file.tar.gz"
echo $NOW
if [ -d $SVDIR/$NOW ]
then
echo '$SVDIR/$NOW is'
else
echo '$NOW Create!'
mkdir $SVDIR/$NOW
fi
#DATA
echo "DATA Bakup Start"
tar zcf $SVDIR/$NOW/$FILE $BKDIR
echo "DATA Bakup End"
ٵ HDD 뷮 Ǿ ִ Ͱ .. HDD 뷮 ŵ..
׳ ִµ..
/bakup ȿ ϴ ؼ
7 ϰ ͽϴ. ( Ϸ ˴ϴ. )
ܼ if ϴ ͱ ϰڴµ..
ϴ ݺ... ڽϴ.
Ȥ ƽô Ŵٸ ˷ֽø ϰڽϴ. | |
|
find . -name "*" -mtime +7 -exec rm -rf {} \;
ٷ rm ϸ κп ls -al {} \; ѹ ð غ
find ϸ ִ ɱ..?
ƴϸ ܼ ش ¥ ǽɵǴ üũؼ ϴ ɱ?! ѹ õغڽϴ.
亯 մϴ!!
¥, ¥, ¥ ε ˻ ϰ (mtime ctime atime )
ɼ ־ پϰ ˻ մϴ.
ش ¥ ǽϴ° ƴ϶ ý۰ ð üũϴ°..