Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
e7918c66
Commit
e7918c66
authored
Feb 02, 2026
by
Downloader
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsync_all.sh: fix contents_index.gz protection from deletion
parent
b38069f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
rsync_all.sh
etersoft-cron/rsync_all.sh
+19
-4
No files found.
etersoft-cron/rsync_all.sh
View file @
e7918c66
...
...
@@ -53,7 +53,7 @@ echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1"
# sync only if main dir is exist
test
-d
"
$RPMS
/
${
1
/\/*/
}
"
||
return
0
mkdir
-p
$RPMS
/
$1
/
rsync
$DELETE
$RSYNCOPTS
--timeout
=
$TIMEOUT
--progress
$CHECKSUM
--stats
-vrlt
--copy-links
$2
\
rsync
$DELETE
$RSYNCOPTS
--timeout
=
$TIMEOUT
--progress
$CHECKSUM
--stats
-vrlt
--copy-links
"
${
@
:2
}
"
\
$RSYNCPATH
/
$1
/
$RPMS
/
$1
/
RES
=
$?
echo
"rsync exit:
$RES
"
...
...
@@ -61,6 +61,18 @@ echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1"
return
$RES
}
# Compress contents_index if changed
compress_contents_index
()
{
local
CI
=
"
$RPMS
/
$1
/base/contents_index"
if
[
-f
"
$CI
"
]
;
then
if
[
!
-f
"
$CI
.gz"
]
||
[
"
$CI
"
-nt
"
$CI
.gz"
]
;
then
echo
"Compressing
$CI
"
gzip
-9
-k
-f
"
$CI
"
fi
fi
}
cd
$RPMS
/
||
exit
1
...
...
@@ -87,8 +99,10 @@ sync_branch()
# 1. sync files, this will skip delete if errors
func
$BRANCH
/
$ARCH
/RPMS.
$COMPONENT
||
return
# 2. sync base
func
$BRANCH
/
$ARCH
/base
||
return
# 3. if all is ok, remove old files
DELETE
=
"--delete-after --max-delete=1000"
func
$BRANCH
/
$ARCH
/base
--exclude
=
contents_index.gz
||
return
# 3. compress contents_index if changed
compress_contents_index
$BRANCH
/
$ARCH
# 4. if all is ok, remove old files
#func $BRANCH/$ARCH '--exclude *SRPMS* --exclude *RPMS.debuginfo* --exclude base/' || return
}
...
...
@@ -100,7 +114,8 @@ sync_branches()
if
[
-n
"
$BASEONLY
"
]
;
then
for
i
in
$LISTARCH
;
do
func
$1
/
$i
/base
DELETE
=
"--delete-after --max-delete=1000"
func
$1
/
$i
/base
--exclude
=
contents_index.gz
compress_contents_index
$1
/
$i
done
return
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment