fixed writing to file

This commit is contained in:
Karol Wypchlo 2021-03-05 23:37:27 +01:00
parent e816a33da1
commit 1762c7f7b7
1 changed files with 2 additions and 3 deletions

View File

@ -76,9 +76,8 @@ async def block_skylinks_from_airtable():
print("Searching nginx cache for blocked files") print("Searching nginx cache for blocked files")
f = open("/tmp/blocklist-aritable.txt", "w") print("Searching nginx cache for blocked files")
f.write("^KEY: .*" + "^KEY: .*\n".join(skylinks)) exec('printf "^KEY: .*' + '\n^KEY: .*'.join(skylinks) + '" > /tmp/blocklist-aritable.txt')
f.close()
cached_files_command = ( cached_files_command = (
"/usr/bin/find /data/nginx/cache/ -type f | /usr/bin/xargs --no-run-if-empty -n1000 /bin/grep -Els --file /tmp/blocklist-aritable.txt" "/usr/bin/find /data/nginx/cache/ -type f | /usr/bin/xargs --no-run-if-empty -n1000 /bin/grep -Els --file /tmp/blocklist-aritable.txt"
) )