blob: 4c8d1348a8d65c3e0c1d8ae7cd4f37f322cfa850 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#! /bin/bash
#find /mnt/provision/kaas/adei -type f -print0 | xargs -0 -I{} -n 1 sh -c ' dd if="$1" of=/dev/null bs=1M status=none || true; sleep .5' _ "{}"
#find /mnt/ands/glusterfs/brick-provision/kaas/bora -type f -size 0 -print0 | \
#while IFS= read -r -d '' f; do
# echo "Remvoing $f"
# setfattr -x trusted.glusterfs.mdata "$f" 2>/dev/null || true
# for a in $(getfattr -d -m trusted.afr -e hex "$f" 2>/dev/null | awk -F= '/trusted\.afr/{print $1}'); do
# setfattr -x "$a" "$f" 2>/dev/null || true
# done
#done
#find /mnt/datastore/services/gogs -type f -print0 | xargs -0 -n200 -P16 rm -
#find /mnt/datastore/services/gogs -depth -type d -empty -delete
#find /mnt/datastore/services/gogs/repositories -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 -I{} -n1 -P200 sh -c 'rm -rf "$1"' _ "{}"
echo 3 | sudo tee /proc/sys/vm/drop_caches
find /mnt/wave/ -type f -print0 | xargs -0 -I{} -n 1 -P 8 sh -c '
f="$1"
dd if="$f" of=/dev/null bs=1M status=none || true;
sz=$(stat -c%s "$f" 2>/dev/null || echo 0)
echo "$f $sz"
if [ "$sz" -eq 0 ]; then
# give gluster a breath and try again, like you do manually
sleep 0.5
dd if="$f" of=/dev/null bs=1M status=none 2>/dev/null || true
# sz=$(stat -c%s "$f" 2>/dev/null || echo 0)
fi
' _ "{}"
#find /mnt/wave/ -type f -print0 | xargs -0 -I{} -n 1 -P 8 sh -c 'echo $1; dd if="$1" of=/dev/null bs=1M status=none || true; sleep .5' _ {}
|