Fixed file permissions

This commit is contained in:
Morten Olsen
2021-12-18 18:51:18 +01:00
parent ecf382b486
commit 3b5dbb0c15
3 changed files with 6 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ RUN yarn bundle
FROM node:alpine FROM node:alpine
COPY entry.sh /entry.sh COPY entry.sh /entry.sh
RUN chmod 711 /entry.sh && apk update && apk add git RUN chmod 755 /entry.sh && apk update && apk add git
COPY --from=BuildEnv /app/dist /app COPY --from=BuildEnv /app/dist /app
CMD ["schedule"] CMD ["schedule"]
ENTRYPOINT ["/entry.sh"] ENTRYPOINT ["/entry.sh"]

View File

@@ -37,3 +37,6 @@ You can also limit which repositories to back up using the environment variables
| | | |-... | | | |-...
``` ```
## Scheduled
If the container is started without a command it will run in scheduled mode. It will run every Sunday at 3 am. This can be overridden using `-e SCHEDULE="0 0 4 * * *"` (Runs at 4 am every day) using the cron time format

View File

@@ -9,7 +9,9 @@ run.action(runBackup)
const schedule = program.command('schedule'); const schedule = program.command('schedule');
schedule.action(() => { schedule.action(() => {
const schedule = process.env.SCHEDULE || '0 0 3 * * Sunday'; const schedule = process.env.SCHEDULE || '0 0 3 * * Sunday';
console.log(`Starting with schedule ${schedule}`)
cron.schedule(schedule, () => { cron.schedule(schedule, () => {
console.log('Starting backup task')
runBackup().catch((err) => { runBackup().catch((err) => {
console.error(err); console.error(err);
process.exit(-1); process.exit(-1);