[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:hardware:arm:slackwarearm_local-mirror-repository [2021/03/14 23:53 (UTC)] – [Using logrotate to manage log files] clearer text revision exagahowtos:hardware:arm:slackwarearm_local-mirror-repository [2021/04/02 19:22 (UTC)] (current) – [local-slackwarearm-repo.sh script code] revised script header info exaga
Line 1: Line 1:
 <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). -->
 ====== Slackware ARM local mirror repository - SAREPO ====== ====== Slackware ARM local mirror repository - SAREPO ======
 +
 +It is acknowledged that there are more complete and distinguished Slackware repository solutions readily available. Such as, alienBOB's [[http://slackware.uk/people/alien/tools/|gen_repos_files.sh]] and [[http://http://slackware.uk/people/alien/tools/|mirror-slackware-current.sh]] scripts, and Dave Spencer's [[http://https://idlemoor.github.io/slackrepo/|slackrepo]]. These are renowned, highly automated, tools for managing Slackware package repositories and  mirrors. 
  
 ===== Preface ===== ===== Preface =====
  
-It is acknowledged that there are more complete and distinguished Slackware repository solutions readily available. Such asalienBOB's [[http://slackware.uk/people/alien/tools/|gen_repos_files.sh]] and [[http://http://slackware.uk/people/alien/tools/|mirror-slackware-current.sh]] scripts, and Dave Spencer'[[http://https://idlemoor.github.io/slackrepo/|slackrepo]]. These are renowned, highly automated, tools for managing Slackware package repositories and  mirrors. The script featured here does not attempt to supplant or undermine these (or other) contemporary efforts, by //re-inventing the wheel//, so to speak. It's just a much less sophisticated method of achieving the same results, and very much **Slackware ARM specific**. +The script featured here, 'local-slackwarearm-repo.sh' [nickname'SAREPO'] does not attempt to supplant or undermine the above (or other) contemporary efforts, by //re-inventing the wheel//, so to speak. It's just a much less sophisticated method of achieving the same results, and very much **Slackware ARM specific**. 
  
 When I was looking into creating a local Slackware ARM mirror, most of the currently available scripts and software to perform this task was just way too advanced and extensive for my needs with regards to Slackware "//repodemia//". Something much more basic and bespoke was preferable, and that's the main reason why this script was created. When I was looking into creating a local Slackware ARM mirror, most of the currently available scripts and software to perform this task was just way too advanced and extensive for my needs with regards to Slackware "//repodemia//". Something much more basic and bespoke was preferable, and that's the main reason why this script was created.
 +
  
 ===== Question & Answer ===== ===== Question & Answer =====
Line 58: Line 61:
 # Create Slackware ARM local repository mirror utility script. # Create Slackware ARM local repository mirror utility script.
 # #
-# local-slackwarearm-repo.sh - SAREPO [v2.0.3]+# local-slackwarearm-repo.sh - SAREPO [v2.0.3] -  13 Mar 2021
 # #
-# Exaga - exaga@fatdog.eu - SARPi Project - 13 Mar 2021+Copyright (c) 2021 Exaga - SARPi Project - sarpi.penthux.net
 # #
 # Version - 08 Mar 2021 [v0.1a] - progenitor # Version - 08 Mar 2021 [v0.1a] - progenitor
Line 230: Line 233:
   cd "${SOURCEDIR}"   cd "${SOURCEDIR}"
   echo "${PETNAM} : verifying ${PRGNAM}.database ..."   echo "${PETNAM} : verifying ${PRGNAM}.database ..."
-  find . -type f ! -name "index.html" -exec ls -la --time-style=full "{}" >> "${TMP_DATA_DB}" \; +  find . -type f ! -name "index.html" -print0 | xargs -0 ls -la --time-style=full >> "${TMP_DATA_DB}"  
-  if cmp -s "${TMP_DATA_DB}" "${LOCAL_SAREPO_DB}"  ; then  +  cmp -s "${TMP_DATA_DB}" "${LOCAL_SAREPO_DB}" && CMPSTATUS=0 || CMPSTATUS=1 
-    log "${PETNAM} : Local repository database is up-to-date ... "+  if [[ $CMPSTATUS -eq 0 ]]; then  
 +    log "${PETNAM} : Local repository database is up-to-date ..."
   else    else 
     rm -f "${LOCAL_SAREPO_DB}" && mv "${TMP_DATA_DB}" "${LOCAL_SAREPO_DB}" && log "${PETNAM} : [!] Local repository database updated!"     rm -f "${LOCAL_SAREPO_DB}" && mv "${TMP_DATA_DB}" "${LOCAL_SAREPO_DB}" && log "${PETNAM} : [!] Local repository database updated!"
   fi   fi
   log "${PETNAM} : local repository audit complete"     log "${PETNAM} : local repository audit complete"  
-  log "+-----------------------------------------------+"+  log "+-----------------------------------------------+" && echo >> ${LOG_FILE}
   echo "${PETNAM} update complete"   echo "${PETNAM} update complete"
   # Done   # Done
Line 406: Line 410:
 '**compressoptions**', '**compressext**' = compress the file using max '-9' compression, giving it an '.xz' extension. \\ '**compressoptions**', '**compressext**' = compress the file using max '-9' compression, giving it an '.xz' extension. \\
 '**create 644 <username> users**' = create a NEW log file in place of the rotated file under '<username>' 'group' permissions. '**create 644 <username> users**' = create a NEW log file in place of the rotated file under '<username>' 'group' permissions.
 +
 +Things to do or avoid: \\
 +__DO__ read the '**man logrotate**' page to gain some understanding of the different settings and parameters - https://linux.die.net/man/8/logrotate \\
 +__DON'T__ set an '**olddir**' PATH (where applicable) if the '**<username>**' does not have access or else 'logrotate' will fail-error. \\
 +
  
 Save and exit the file once you are happy with the configuration settings within. Save and exit the file once you are happy with the configuration settings within.
 howtos:hardware:arm:slackwarearm_local-mirror-repository ()