Commit 0a24ff50 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update-deffered.sh: add crdate function for Sisyphus archive

Replace etertimemachine with custom crdate function that: - Creates daily snapshots with hardlinks - Copies base/ directories separately (not hardlinked) - Maintains 'last' symlink atomically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
parent e9f5cbc0
#!/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/Etersoft/Sisyphus/Deferred /var/ftp/pub/Etersoft/Sisyphus/archive
etertimemachine update --link /var/ftp/pub/ALTLinux/Sisyphus /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
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