Commit 7782b2ae authored by Seblu's avatar Seblu
Browse files

Move all symlink stuff into arm-link

The only one is $LAST, because it needs to be updated only when rsync was
successful
parent ecab9af8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@
LOCKFILE=~/."${0##*/}".lock
ARMBASE=/srv/ftp/archlinux/arm
PREFIX=packages
LASTM=month
LASTW=week

[[ $1 != "" && ${1:0:1} != / ]] && { echo 'Absolute path please'; exit 1; }

@@ -31,6 +33,12 @@ umask 022

cd "$ARMBASE"

# update last month
ln -snf "$(date +%Y/%m/01)" "$LASTM"

# update last week
ln -snf "$(date -d 'last monday' +%Y/%m/%d)" "$LASTW"

# clean dead links pass
echo ':: clening dead links'
[[ -d "$PREFIX" ]] && find -L "$PREFIX" -type l -delete -print
+0 −7
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ ARMBASE=/srv/ftp/archlinux/arm
SNAPR="$(date +%Y/%m/%d)"
SNAP="$ARMBASE/$SNAPR"
LAST="$ARMBASE/last"
LASTM="$ARMBASE/month"
LASTW="$ARMBASE/week"

# we lock!
exec 9> "$LOCKFILE"
@@ -47,11 +45,6 @@ touch "$SNAP"
# update last
ln -snf "$SNAPR" "$LAST"

# update last month
ln -snf "$(date +%Y/%m/01)" "$LASTM"

# update last week
ln -snf "$(date -d 'last monday' +%Y/%m/%d)" "$LASTW"

# use hardlink (in case of error)
#if type -p hardlink &>/dev/null; then