Add a process date for the output filename when loading serials. Change the write method to append. #684

This commit is contained in:
Korina Cordero 2022-06-24 07:13:09 +00:00
parent 7995706dd3
commit ce160c506c
3 changed files with 11 additions and 5 deletions

View file

@ -10,7 +10,7 @@ use Symfony\Component\Dotenv\Dotenv;
$csv = fopen($argv[1], 'r');
$output_file = $argv[2];
$output_fh = fopen($output_file, "w");
$output_fh = fopen($output_file, "a");
if (!file_exists($argv[1]))
{

View file

@ -1,4 +1,6 @@
#!/bin/bash
proc_date=`date +%m-%d-%y`
load_status_file="/tmp/warranty_load_status_$proc_date.txt"
touch /tmp/warranty_download_serial.csv
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-01-22 /tmp/warranty_download_serial.csv 1
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-02-22 /tmp/warranty_download_serial.csv 0
@ -83,5 +85,6 @@ touch /tmp/warranty_download_serial.csv
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-20-22 /tmp/warranty_download_serial.csv 0
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-21-22 /tmp/warranty_download_serial.csv 0
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-22-22 /tmp/warranty_download_serial.csv 0
touch /tmp/warranty_load_status.txt
/usr/bin/php /var/www/resq/utils/load_warranty_serial/bulk_load_serials.php /tmp/warranty_download_serial.csv /tmp/warranty_load_status.txt
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-23-22 /tmp/warranty_download_serial.csv 0
touch $load_status_file
/usr/bin/php /var/www/resq/utils/load_warranty_serial/bulk_load_serials.php /tmp/warranty_download_serial.csv $load_status_file

View file

@ -1,4 +1,6 @@
#!/bin/bash
proc_date=`date +%m-%d-%y`
load_status_file="/tmp/warranty_load_status_$proc_date.txt"
touch /tmp/warranty_download_serial.csv
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-01-22 /tmp/warranty_download_serial.csv 1
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-02-22 /tmp/warranty_download_serial.csv 0
@ -83,5 +85,6 @@ touch /tmp/warranty_download_serial.csv
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-20-22 /tmp/warranty_download_serial.csv 0
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-21-22 /tmp/warranty_download_serial.csv 0
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-22-22 /tmp/warranty_download_serial.csv 0
touch /tmp/warranty_load_status.txt
/usr/bin/php /var/www/resq/utils/load_warranty_serial/bulk_load_serials.php /tmp/warranty_download_serial.csv /tmp/warranty_load_status.txt
/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-23-22 /tmp/warranty_download_serial.csv 0
touch $load_status_file
/usr/bin/php /var/www/resq/utils/load_warranty_serial/bulk_load_serials.php /tmp/warranty_download_serial.csv $load_status_file