Updating prune to work for files too.

This commit is contained in:
Dessalines 2019-11-06 18:14:50 -07:00
parent 10875a8eaf
commit 559a55324c
1 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,5 @@
#!/bin/bash
# This prunes torrents.csv, removing those with too many columns, and sorts it # This prunes torrents.csv, removing those with too many columns, and sorts it
echo "Pruning torrents.csv ..." echo "Pruning torrents.csv ..."
pushd .. pushd ..
@ -50,6 +52,9 @@ cp $torrent_files_csv $torrent_files_csv_tmp
header=$(head -n1 $torrent_files_csv_tmp) header=$(head -n1 $torrent_files_csv_tmp)
sed -i '1d' $torrent_files_csv_tmp sed -i '1d' $torrent_files_csv_tmp
# Remove dups, keeping the last ones
tac $torrent_files_csv_tmp | sort -u -t';' -k1,1 -k2,2 -o $torrent_files_csv_tmp
# Same for the infohashes scanned # Same for the infohashes scanned
sort --field-separator=';' --key=1,2 -o $torrent_files_csv_tmp $torrent_files_csv_tmp sort --field-separator=';' --key=1,2 -o $torrent_files_csv_tmp $torrent_files_csv_tmp