Create zip of the contents of a picoCMS blog (only .md or .adoc)
· 552 B · Text
Raw
#!/bin/bash
BASEDIR=/var/www/www.lema.org
cd $BASEDIR
# Recreate the zip file with only .md and .adoc files, preserving subfolders
# but not the "content/" folder
(cd content && zip -r ../mxd_content.zip . -i '*.md' '*.gmi' '*.adoc')
cd $BASEDIR
# Find all mxd_content.zip files in the current directory and its subdirectories
find . -name "mxd_content.zip" | while read zip_file; do
# Calculate the MD5 hash of the zip file
md5sum "$zip_file" | awk '{print $1}' > "${zip_file%.zip}.md5.txt"
echo "MD5 hash saved for: $zip_file"
done
1 | #!/bin/bash |
2 | |
3 | BASEDIR=/var/www/www.lema.org |
4 | |
5 | cd $BASEDIR |
6 | |
7 | # Recreate the zip file with only .md and .adoc files, preserving subfolders |
8 | # but not the "content/" folder |
9 | (cd content && zip -r ../mxd_content.zip . -i '*.md' '*.gmi' '*.adoc') |
10 | |
11 | cd $BASEDIR |
12 | |
13 | # Find all mxd_content.zip files in the current directory and its subdirectories |
14 | find . -name "mxd_content.zip" | while read zip_file; do |
15 | # Calculate the MD5 hash of the zip file |
16 | md5sum "$zip_file" | awk '{print $1}' > "${zip_file%.zip}.md5.txt" |
17 | echo "MD5 hash saved for: $zip_file" |
18 | done |
19 |