Add cron script
This commit is contained in:
parent
dee41dc775
commit
e71f2b89fc
1 changed files with 19 additions and 0 deletions
19
cron.sh
Normal file
19
cron.sh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source="/home/ci/sftp-root/CIAptPackages";
|
||||||
|
destination="/srv/aptosaurus/sources";
|
||||||
|
aptosaurus="/srv/aptosaurus/aptosaurus.sh";
|
||||||
|
# The user account to chown to & run aptosaurus under
|
||||||
|
# FUTURE: Use own account? Is it worth it for a cron job?
|
||||||
|
user_account="daemon";
|
||||||
|
|
||||||
|
# Locate & move the .dev files into place
|
||||||
|
find "${source}" -type f -name "*.deb" -print0 | xargs -n1 -I{} --null mv "{}" "${destination}";
|
||||||
|
|
||||||
|
# chown them to the right user account
|
||||||
|
chown -R "${user_account}:${user_account}" "${destination}";
|
||||||
|
|
||||||
|
# Re-run aptosaurus
|
||||||
|
aptosaurus_dir="$(dirname "${aptosaurus}")";
|
||||||
|
cd "${aptosaurus_dir}" || exit 1;
|
||||||
|
sudo -u "${user_account}" "$(basename "${aptosaurus}")";
|
Loading…
Reference in a new issue