20 lines
360 B
Bash
Executable File
20 lines
360 B
Bash
Executable File
#! /bin/bash
|
|
|
|
s3cmd ls s3://k3s-main-backup/ziptars/ > /root/s3_uploads.txt
|
|
cd /home/ziptars/
|
|
for file in *;
|
|
do
|
|
if [[ -n $(grep "$file" /root/s3_uploads.txt) ]]; then
|
|
echo $file uploaded >> /root/uploads_success.txt
|
|
|
|
else
|
|
s3cmd put "$file" "s3://k3s-main-backup/ziptars/$file"
|
|
echo $file missing uploaded >> /root/uploads_success.txt
|
|
|
|
fi
|
|
|
|
|
|
done
|
|
|
|
cd
|