Скрипты для Linux
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
523 B

#!/bin/bash
# Выясняем, какие старые архивы нам нужно удалить
maxFilesCount=3
files=`find /home/home_backup_*|sort`
delFiles=`./GetDelFileList $maxFilesCount "${files}"`
# Делаем бекап
cd /home
sudo tar cvpzf home_backup_$(date +%yy%mm%dd-%Hh%Mm%Ss).tgz \
--exclude=home_backup*.tgz \
--exclude=.thumbnails \
--exclude=.mozilla/firefox/*.default/Cache \
--exclude=.googleearth/Cache \
.
# Удаляем старые архивы
for i in $delFiles
do
sudo rm $i
done