Compare commits

...

3 Commits

Author SHA1 Message Date
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
5 changed files with 77 additions and 8 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
==========
+1 -1
View File
@@ -19,7 +19,7 @@ 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
==========
+1 -1
View File
@@ -1 +1 @@
0.9.3
0.9.6
+57
View File
@@ -0,0 +1,57 @@
#!/bin/bash
Src=${1}
Days=${2}
if [ "${Src}" == "" ]
then
echo "Usage: $0 <source_dir> [<num_days>]"
exit 1
fi
if [ "${Days}" == "" ]
then
Days=30
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} == 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 echo $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