Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
e335ec2c
Commit
e335ec2c
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
scheduler: remove code
parent
00bf94cc
Branches
Branches containing commit
No related tags found
1 merge request
!26
Eliminate scheduler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scheduler.sh
+0
-131
0 additions, 131 deletions
scheduler.sh
with
0 additions
and
131 deletions
scheduler.sh
+
0
−
131
View file @
e335ec2c
...
@@ -29,135 +29,4 @@ echo "ERROR: $0 was DISABLED."
...
@@ -29,135 +29,4 @@ echo "ERROR: $0 was DISABLED."
echo
"start
$(
dirname
\"
$0
\"
)
/backup.sh by cron when you wish to start the backup."
echo
"start
$(
dirname
\"
$0
\"
)
/backup.sh by cron when you wish to start the backup."
exit
1
exit
1
.
`
dirname
$0
`
/jobhelper.sh
typeset
-i
rcScheduler
=
0
typeset
-i
rcTransfer
=
0
bStart
=
1
# --------------------------------------------------------------------------------
# checks
# --------------------------------------------------------------------------------
j_requireUser
"root"
# --- read schedulerdata
j_read
cat
<<
EOFschedulerinfo
execution times:
$JOBDEF_INC
at `_j_getvar
${
JOBFILE
}
"start-time-inc"`
Full backup :
$JOBDEF_FULL
at `_j_getvar
${
JOBFILE
}
"start-time-full"`
do today =
$JOB_DOTODAY
type =
$JOBDEF_TYPE
$JOBDEF_AUTO
starttime =
$JOBDEF_STARTTIME
stopfile =
$JOB_DONEFILE
EOFschedulerinfo
if
[
$JOB_DOTODAY
-eq
0
]
;
then
echo
"ABORT: nothing to do today"
bStart
=
0
fi
# check: Backup bereits gelaufen?
ls
-l
${
JOB_DONEFILE
}
.
*
2>/dev/null
if
[
$?
-eq
0
]
;
then
echo
echo
"ABORT:
$JOB_DONEFILE
was found"
bStart
=
0
else
echo
"Job was not started yet."
fi
if
[
${
JOBDEF_STARTTIME
}
-gt
${
mytime
}
]
;
then
echo
"INFO: waiting for next run at
${
JOBDEF_STARTTIME
}
..."
bStart
=
0
fi
if
[
"
$1
"
=
"-f"
-o
"
$1
"
=
"--force"
]
;
then
echo
FORCE parameter detected.
echo
Overriding settings to make an incremental backup now.
JOB_DOTODAY
=
1
JOBDEF_TYPE
=
inc
JOBDEF_STARTTIME
=
`
date
+%H%M
`
bStart
=
1
fi
if
[
"
$1
"
=
"-d"
-o
"
$1
"
=
"--dryrun"
]
;
then
echo
DRYRUN parameter detected
bStart
=
0
fi
# --------------------------------------------------------------------------------
if
[
$bStart
-eq
1
]
;
then
# ----- local dumps
echo
"INFO:
`
date
`
- starting backup ... type
$JOBDEF_TYPE
- time
$JOBDEF_STARTTIME
"
|
tee
-a
$JOB_LOGFILE
touch
"
${
JOB_DONEFILE
}
.01.START"
cat
$JOBFILE
>>
$JOB_LOGFILE
echo
"INFO:
`
date
`
- Making local backups ...
${
DIR_SELF
}
/localdump.sh ALL"
|
tee
-a
$JOB_LOGFILE
${
DIR_SELF
}
/localdump.sh ALL |
tee
-a
$JOB_LOGFILE
rcScheduler
=
$?
echo
"INFO:
`
date
`
- local backups were finished"
|
tee
-a
$JOB_LOGFILE
sleep
2
# ----- transfer
if
[
-x
"
${
DIR_SELF
}
/transfer.sh"
]
;
then
# transfer files
echo
"INFO:
`
date
`
- Sending data to storage...
${
DIR_SELF
}
/transfer.sh
$JOBDEF_TYPE
"
|
tee
-a
$JOB_LOGFILE
touch
"
${
JOB_DONEFILE
}
.02.STARTTRANSFER"
${
DIR_SELF
}
/transfer.sh
$JOBDEF_TYPE
$JOBDEF_AUTO
2>&1 |
tee
-a
$JOB_LOGFILE
rcTransfer
=
$?
else
echo
"SKIP - transfer.sh not found; all files will be kept on local filesystem only"
|
tee
-a
$JOB_LOGFILE
fi
rcScheduler
=
$rcScheduler
+rcTransfer
echo
"INFO:
`
date
`
- DONE"
|
tee
-a
$JOB_LOGFILE
touch
"
${
JOB_DONEFILE
}
.03.DONE"
echo
echo
log
for
this executed job is
ls
-l
$JOB_LOGFILE
echo
echo
"INFO:
`
date
`
- cleanup logs"
echo
find
"
${
DIR_LOGS
}
"
-mtime
+28
-delete
-print
find
"
${
DIR_LOGS
}
"
-mtime
+28
-delete
-print
echo
echo
STATUS
$0
exit
with final returncode
rc
=
$rcScheduler
|
tee
-a
$JOB_LOGFILE
echo
else
echo
"Nothing to do."
fi
# --------------------------------------------------------------------------------
exit
$rcScheduler
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment