Compare commits

..

5 Commits

Author SHA1 Message Date
oleg f391593857 progress 2024-07-19 11:04:30 -04:00
oleg 108ae35a06 progress 2024-07-19 10:45:46 -04:00
oleg 2416a5a77e progress 2024-07-19 10:37:45 -04:00
oleg 0b9feb8610 progress 2024-07-19 10:25:26 -04:00
oleg 51e059a72b fix 2024-07-19 09:47:18 -04:00
6 changed files with 83 additions and 27 deletions
+4 -6
View File
@@ -30,13 +30,11 @@ C R Y P T O M A R K E T D A T A
==========
Storage
==========
| created by crontabs:
| cvttdata:
| /home/cvtt/prod/utils/sync_crypto_archives.sh
| TBD prune files older than 7 days
| created by crontab cvttdata:
| /home/cvtt/prod/utils/sync_market_data.sh (ops/utls)
| stored in:
| homestore:/works/cvtt/md_archive/crypto/ (cvttdata and cloud21)
| cloud21:/opt/store/cvtt/md_archive/crypto/ (cvttdata and cloud21)
| homestore:/works/cvtt/md_archive/equity/alpaca_md
| cloud21:/opt/store/cvtt/md_archive/equity/alpaca_md
|
v
==========
+6 -19
View File
@@ -19,28 +19,15 @@ E Q U I T Y M A R K E T D A T A
| created by crontab on cvttdata:
| /home/cvtt/prod/run/alpaca_md.sh
| stored in:
| cvttdata:/home/cvtt/prod/archive/md_archive/equity/alpaca_md (TBD)
| cvttdata:/home/cvtt/prod/archive/md_archive/equity/alpaca_md
|
v
==========
Storage
==========
| created by crontabs:
| cvttdata:
|
| created by crontab cvttdata:
| /home/cvtt/prod/utils/sync_market_data.sh
| stored in:
| homestore:/works/cvtt/md_archive/crypto/cvttdata
| homestore:/works/cvtt/md_archive/crypto/cloud21
| backed up in:
| cloud21:/opt/store/cvtt/md_archive/crypto/cvttdata
| cloud21:/opt/store/cvtt/md_archive/crypto/cloud21
v
==========
Usage
==========
| homestore:/works/cvtt/md_archive/equity/alpaca_md
| cloud21:/opt/store/cvtt/md_archive/equity/alpaca_md
____V_______
+1 -1
View File
@@ -1 +1 @@
0.9.2
0.9.7
+1 -1
View File
@@ -109,6 +109,6 @@ done
echo "Compressing"
for file in $(find ${OutputDir} -type f -name '*db' -print )
do
echo "Compressing ${file}
echo "Compressing ${file}"
gzip ${file}
done
+57
View File
@@ -0,0 +1,57 @@
#!/bin/bash
Src=${1}
Days=${2}
if [ -z "$Days" ] || [ -z "$Src" ]; then
echo "Usage: $0 <source_dir> <num_days>"
exit 1
fi
# Add / if Src does not have it (symlinks)
if [ "${Src: -1}" != "/" ]; then
Src="${Src}/"
fi
declare -A Settings=()
Settings[Src]=${Src}
Settings[PruneDate]=$(date -d "${Days} days ago" '+%Y-%m-%d')
src=${Settings[Src]}
prune_date=${Settings[PruneDate]}
echo "Finding files older than ${prune_date}..."
Cmd="find ${src} -type f ! -newermt \"${prune_date}\""
echo ${Cmd}
files=($(eval ${Cmd}))
total_files=${#files[*]}
if [[ ${total_files} == 0 ]]
then
echo "No files found to be pruned. Bye..."
exit 0
fi
echo Before Pruning....
duf ${src}
echo "The following files will be removed:"
echo "===================================="
for f in $files ; do ls -l $f; done
echo "===================================="
echo "Total files to be pruned: ${total_files}"
Cmd="${Cmd} -delete"
echo ${Cmd}
eval ${Cmd}
echo "Removing empty directories..."
Cmd="find ${src} -type d -empty -print -delete"
echo ${Cmd}
eval ${Cmd}
echo After Pruning....
duf ${src}
echo $0 Done
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
Source=/home/cvtt/prod/archive/md_archive/
Targets=
Targets="${Targets} oleg@homestore.cvtt.vpn:/works/cvtt/md_archive/"
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/"
for tgt in ${Targets}
do
Cmd="/usr/bin/rsync -ahv ${Source} ${tgt}"
echo $Cmd
eval $Cmd
done