sysmocom-backup-data: Avoid an absolute symlink to fix restoring

When restoring the backup the rootfs is mounted in /rootfs/data
and the symlink to the real file would then not work. Attempt to
change the directory first to get a relative symlink.

Untested change and needed for rauc
This commit is contained in:
Holger Hans Peter Freyther 2015-11-20 21:45:34 +00:00
parent 20e26fcd3b
commit 8ce4ab4927
1 changed files with 2 additions and 1 deletions

View File

@ -70,7 +70,8 @@ do_backup_files() {
tar -rf $BACKUP_FILE --transform='s,^,info/,' -C $NAME installed_packages mac_addr tar -rf $BACKUP_FILE --transform='s,^,info/,' -C $NAME installed_packages mac_addr
# 6. Create stable link # 6. Create stable link
ln -sf $BACKUP_FILE /data/sysmocom-backup.tar cd /data/
ln -sf `basename $BACKUP_FILE` sysmocom-backup.tar
# 76 # 76
echo "The backup was stored to $BACKUP_FILE" echo "The backup was stored to $BACKUP_FILE"