I have written a little script that backs up the symlinks for a user into a .txt file:
#!/bin/bash
# this script simply checks for symlinks in a users directory, and saved it as a .txt file. This is purely for when we have
# to do a recover of the server.
USERS=$(/usr/local/hestia/bin/v-list-users plain | awk '{print $1}')
for user in $USERS; do
echo "BLA: $user"
output=$(cd /home/$user/ && find . -maxdepth 10 -type l -ls)
echo "$output" > /home/$user/symlinks.txt
done
This works fine when run manually, but on cron with:
5 * * * * bash /root/symlink-backups-per-user.sh
I get:
/usr/local/hestia/bin/v-list-users: line 17: /func/main.sh: No such file or directory
/usr/local/hestia/bin/v-list-users: line 112: /data/users/admin/user.conf: No such file or directory
/usr/local/hestia/bin/v-list-users: line 112: /data/users/camping/user.conf: No such file or directory
Hmm the cron just ran, but same error. This is my script:
#!/bin/bash
# this script simply checks for symlinks in a users directory, and saved it as a .txt file. This is purely for when we have
# to do a recover of the server.
HESTIA="/usr/local/hestia"
USERS=$(/usr/local/hestia/bin/v-list-users plain | awk '{print $1}')
for user in $USERS; do
echo "BLA: $user"
output=$(cd /home/$user/ && find . -maxdepth 10 -type l -ls)
echo "$output" > /home/$user/symlinks.txt
done