aboutsummaryrefslogtreecommitdiffstats
path: root/weeklyjob.sh
blob: 412685e58701080a430f3a0d348b83deabee789e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

# Cronjob which can be run weekly to run the upgrade helper script.
# Add the job in /etc/crontab like below.
#
# It will execute weekly at the same hour (8 AM).
#
# 00 8   * * 6   auh  /home/auh/bin/weeklyjob.sh

# Re-assign these to match your setup!
auh_dir=~/auto-upgrade-helper
poky_dir=~/poky
build_dir=~/build-tmp-auh-upgrades
sstate_dir=~/sstate-cache

pushd $poky_dir

# Base the upgrades on poky master
git fetch origin
git checkout -B tmp-auh-upgrades origin/master

source $poky_dir/oe-init-build-env $build_dir
$auh_dir/upgradehelper.py -e all

# clean up to avoid the disk filling up
rm -rf $build_dir/tmp/
rm -rf $build_dir/workspace/sources/*
find $sstate_dir -atime +10 -delete

popd