#!/bin/bash
#
# This file is part of vospace-transfer-service
# Copyright (C) 2021 Istituto Nazionale di Astrofisica
# SPDX-License-Identifier: GPL-3.0-or-later
#

users=$(getent passwd | awk -F: '$3 > 1000 {print $1}')

for user in $users
do
    mkdir -p /mnt/hot_storage/users/${user}
    cp -r /home/test_import/ /mnt/hot_storage/users/${user}/
    chown -R $user /mnt/hot_storage/users/${user}
    chmod -R 755 /mnt/hot_storage/users/${user}
done

crond && /usr/bin/python3.11 transfer_service.py 2>&1 >> /var/log/vos_ts/error.log
