Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LYSrdiff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Lysator
LYSrdiff
Commits
1337906f
Commit
1337906f
authored
16 years ago
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
Added lysrdiff-move-many and lysrdiff-clone-tasks.
parent
1e32dfc2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+2
-0
2 additions, 0 deletions
Makefile
lysrdiff-clone-tasks
+23
-0
23 additions, 0 deletions
lysrdiff-clone-tasks
lysrdiff-move-many
+69
-0
69 additions, 0 deletions
lysrdiff-move-many
with
94 additions
and
0 deletions
Makefile
+
2
−
0
View file @
1337906f
...
...
@@ -12,6 +12,8 @@ install: install-one-task
cp
lysrdiff-df
$(
BINDIR
)
/
cp
lysrdiff-move-obsolete
$(
BINDIR
)
/
cp
lysrdiff-move-job
$(
BINDIR
)
/
cp
lysrdiff-clone-tasks
$(
BINDIR
)
/
cp
lysrdiff-move-many
$(
BINDIR
)
/
cp
lysrdiff-label-disk
$(
BINDIR
)
/
cp
lysrdiff-sizechange.py
$(
BINDIR
)
/
...
...
This diff is collapsed.
Click to expand it.
lysrdiff-clone-tasks
0 → 100755
+
23
−
0
View file @
1337906f
#!/bin/sh
for
disk
in
1 2
do
for
copy
in
A B
do
for
part
in
0 1
do
id
=
"/lysrdiff/
$disk
/
$copy
/
$part
/lysrdiff.id"
if
[
-f
"
$id
"
]
then
if
[
"
`
cat
$id
`
"
!=
"
$disk
$copy
$part
"
]
then
echo
wrong disk mounted at /lysrdiff/
$disk
/
$copy
/
$part
>
&2
else
cp
/lysrdiff/
$disk
/perm/
$part
/lysrdiff/tasks
\
/lysrdiff/
$disk
/
$copy
/
$part
/lysrdiff/tasks.tmp
\
&&
mv
-f
/lysrdiff/
$disk
/
$copy
/
$part
/lysrdiff/tasks.tmp
\
/lysrdiff/
$disk
/
$copy
/
$part
/lysrdiff/tasks
fi
fi
done
done
done
This diff is collapsed.
Click to expand it.
lysrdiff-move-many
0 → 100755
+
69
−
0
View file @
1337906f
#!/bin/sh
usage
()
{
echo
$0
: usage:
echo
"
$0
fromdisk/frompart todisk/topart size"
echo
echo
Example:
echo
"
$0
1/0 2/1 12"
echo
would move 12 GB from /lysrdiff/1/perm/0 to /lysrdiff/2/perm/1.
echo
echo
Please use lysrdiff-move-obsolete to fix the clones.
}
if
[
$#
-ne
3
]
then
usage
>
&2
exit
1
fi
case
"
$1
"
in
*
/
*
)
;;
*
)
usage
;
exit
1
;;
esac
case
"
$2
"
in
*
/
*
)
;;
*
)
usage
;
exit
1
;;
esac
SRC_DISK
=
`
echo
$1
|
sed
's%/.*%%'
`
SRC_PART
=
`
echo
$1
|
sed
's%.*/%%'
`
DST_DISK
=
`
echo
$2
|
sed
's%/.*%%'
`
DST_PART
=
`
echo
$2
|
sed
's%.*/%%'
`
SIZE_GB
=
$3
SRC_ID
=
/lysrdiff/
$SRC_DISK
/perm/
$SRC_PART
/lysrdiff.id
DST_ID
=
/lysrdiff/
$DST_DISK
/perm/
$DST_PART
/lysrdiff.id
free_space
()
{
stat
-f
-c
'%f * %S'
$1
|xargs
expr
}
if
[
$SRC_ID
=
$DST_ID
]
then
echo
cannot move to self
>
&2
exit
1
fi
DST_START_SIZE
=
`
free_space
$DST_ID
`
GB
=
`
expr
1024
'*'
1024
'*'
1024
`
SIZE_BYTES
=
`
expr
$SIZE_GB
'*'
$GB
`
DST_TARGET_SIZE
=
`
expr
$DST_START_SIZE
-
$SIZE_BYTES
`
if
[
$DST_TARGET_SIZE
-lt
$GB
]
then
echo
This move would leave less than 1 GB free space
>
&2
exit
1
fi
while
[
`
free_space
$DST_ID
`
-gt
$DST_TARGET_SIZE
]
do
lysrdiff-move-job
$SRC_DISK
/
$SRC_PART
$DST_DISK
/
$DST_PART
||
exit
1
done
echo
Move complete.
echo
echo
Please use lysrdiff-move-obsolete to clean up.
exit
0
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