Answer the question
In order to leave comments, you need to log in
How to make an array for find command path?
Greetings!
There is the following code which does something with the found images.
DIR="/var/www/subdomain.example.com/upload/"
STORAGE="gs://images.example.com/" #storage on google cloud
LIST="logs/urls.txt"
######################################################################
######################################################################
######################################################################
######################################################################
DIR_FROM_EXECUTED="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
if ; then
mkdir -p "$DIR_FROM_EXECUTED/logs/"
fi
> "$DIR_FROM_EXECUTED/logs/urls.txt"
> "$DIR_FROM_EXECUTED/logs/lastlog.txt"
find "$DIR" -regextype posix-extended -iregex ".*\.(png|jpg|gif|jpeg|ico|svg)" -not -path "${DIR}tmp/*" -print > "$LIST"
while read URL
do
URLTOUPLOAD=$(echo $STORAGE$URL | sed "[email protected]${DIR}@@g")
gsutil -m cp "$URL" "$URLTOUPLOAD" > /dev/null 2>&1
echo "$URL" "=>" "$URLTOUPLOAD" | sed "[email protected]:@https:@g" | tee -a "$DIR_FROM_EXECUTED/logs/lastlog.txt"
gsutil -m acl ch -u AllUsers:R "$URLTOUPLOAD" > /dev/null 2>&1
gsutil -m setmeta -h "Cache-Control:public, max-age=31536000" "$URLTOUPLOAD" > /dev/null 2>&1
rm -f "$URL" > /dev/null 2>&1
done < $LIST
grep -rl "server_name " /etc/nginx/conf.d/ | sed '/default/d' | sed '/sclool.tools/d' | sed '/images.interatletika/d' | sed 's/.conf//g' | sed 's/\/etc\/nginx.d\//\/var\/www\//g
Answer the question
In order to leave comments, you need to log in
for i in `mysql -uroot -pPass -e'show databases;' | grep -v information_schema | grep -v Database`; do mysqldump -uroot -pDungeonKeeper $i > /var/backup/mysql/last/$i.sql;done >> /dev/null 2>> /var/log/sqlbackup.log
tar -czvf /var/backup/mysql/`date +%Y`/sqldump-`date +%Y-%m-%u`.tar.gz ./last >> /dev/null > /var/log/sqlbackup.log
It is possible so to try, only $LIST It is necessary to nullify.
grep -rl "server_name " /etc/nginx/conf.d/ | sed '/default/d' | sed '/sclool.tools/d' | sed '/images.interatletika/d' | \ sed 's/.conf//g' | sed 's/\/etc\/nginx.d\//\/var\/www\//g | \
xargs find {} -regextype posix-extended -iregex ".*\.(png|jpg|gif|jpeg|ico|svg)" -not -path "${DIR}tmp/*" -print >> "$LIST" \;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question