Commit f306edc8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update-deferred: fix script and remove misspelled duplicate

parent afb24b6b
#!/bin/sh
# see ssh lav@spacerOC
# TODO: использовать COW
exit 1
copy_base()
{
local from="$1"
local to="$2"
for i in $from/*/base ; do
arch="$(basename $(dirname $i))"
rm -r $to/$arch/base
cp -a $i $to/$arch/base
done
}
crdate()
{
shift 2
from="$1/last"
to="$1"
local from="$1"
local to="$2"
d="$(date "+%Y-%m-%d")"
#d="2025-05-28"
[ -d "$to/$d" ] && return 1
cp -la "$from" "$to/$d"
touch "$to/$d"
copy_base "$from" "$to/$d"
ln -s "$d" "$to/last-new" || return 1
# TODO: exchange
rm "$to/last"
mv "$to/last-new" "$to/last"
}
# Создание и обновление архива
#etertimemachine update --link /var/ftp/pub/Etersoft/Sisyphus/Deferred /var/ftp/pub/Etersoft/Sisyphus/archive
crdate /var/ftp/pub/Etersoft/Sisyphus/archive
#etertimemachine update --link /var/ftp/pub/ALTLinux/Sisyphus /var/ftp/pub/Etersoft/Sisyphus/archive
crdate /var/ftp/pub/ALTLinux/Sisyphus /var/ftp/pub/Etersoft/Sisyphus/archive
# Откладывание даты
#etertimemachine rotate --link /var/ftp/pub/Etersoft/Sisyphus/archive
#!/bin/sh
# TODO: использовать COW
copy_base()
{
local from="$1"
local to="$2"
for i in $from/*/base ; do
arch="$(basename $(dirname $i))"
rm -r $to/$arch/base
cp -a $i $to/$arch/base
done
}
crdate()
{
local from="$1"
local to="$2"
d="$(date "+%Y-%m-%d")"
#d="2025-05-28"
[ -d "$to/$d" ] && return 1
cp -la "$from" "$to/$d"
copy_base "$from" "$to/$d"
ln -s "$d" "$to/last-new" || return 1
# TODO: exchange
rm "$to/last"
mv "$to/last-new" "$to/last"
}
# Создание и обновление архива
#etertimemachine update --link /var/ftp/pub/ALTLinux/Sisyphus /var/ftp/pub/Etersoft/Sisyphus/archive
crdate /var/ftp/pub/ALTLinux/Sisyphus /var/ftp/pub/Etersoft/Sisyphus/archive
# Откладывание даты
#etertimemachine rotate --link /var/ftp/pub/Etersoft/Sisyphus/archive
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment