forked from sqlitebrowser/sqlitebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shell script used on the nightly build server to move builds into sub…
…dirs Runs automatically from cron every month, on the 14th day of each month. It's pretty simple, but should do the job
- Loading branch information
1 parent
42fc608
commit 38be4fe
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Moving the nightly builds into appropriate subdirs. Designed to be | ||
# run automatically from cron, using something like this: | ||
# 10 0 14 * * /usr/local/bin/move_nightlies_into_dirs.sh | ||
|
||
# Retrieve the month number for last month | ||
YEARMONTH=`date -d "last month 13:00" '+%Y-%m'` | ||
YEARMONTHOSX=`date -d "last month 13:00" '+%Y%m'` | ||
|
||
# Create appropriate new subfolders | ||
mkdir /nightlies/osx/${YEARMONTH} | ||
mkdir /nightlies/win32/${YEARMONTH} | ||
mkdir /nightlies/win64/${YEARMONTH} | ||
|
||
# Move builds | ||
mv /nightlies/osx/DB*${YEARMONTHOSX}* /nightlies/osx/${YEARMONTH}/ | ||
mv /nightlies/win32/DB*${YEARMONTH}* /nightlies/win32/${YEARMONTH}/ | ||
mv /nightlies/win64/DB*${YEARMONTH}* /nightlies/win64/${YEARMONTH}/ | ||
|
||
# Fix ownership and context | ||
chown -Rh nightlies: /nightlies/osx/${YEARMONTH} /nightlies/win32/${YEARMONTH} /nightlies/win64/${YEARMONTH} | ||
restorecon -RFv /nightlies/osx/${YEARMONTH} /nightlies/win32/${YEARMONTH} /nightlies/win64/${YEARMONTH} | ||
|
||
echo Nightlies moved for $YEARMONTH |