diff --git a/utils/get_warranty_serial/new_get_serials.php b/utils/get_warranty_serial/new_get_serials.php index 45161f3a..61477885 100644 --- a/utils/get_warranty_serial/new_get_serials.php +++ b/utils/get_warranty_serial/new_get_serials.php @@ -8,8 +8,10 @@ use MicrosoftAzure\Storage\Blob\BlobRestProxy; use MicrosoftAzure\Storage\Common\ServiceException; -$blob_url = 'https://popappshopprodstorage.blob.core.windows.net'; -$sas_token = 'sp=r&st=2021-04-13T03:48:30Z&se=2022-04-01T11:48:30Z&spr=https&sv=2020-02-10&sr=c&sig=L6VDl40qRXhQb7w8JVkj3r7x2Xkt72pQaQ8AH2M5CRk%3D'; +// $blob_url = 'https://popappshopprodstorage.blob.core.windows.net'; +$blob_url = 'https://motivstorageaccount.blob.core.windows.net'; + +$sas_token = 'sp=r&st=2022-06-16T04:09:13Z&se=2030-06-16T12:09:13Z&spr=https&sv=2021-06-08&sr=c&sig=x26qUFEMIqg4JgTCVHoDv%2FtTqCprjogEqtOsTpBjkWA%3D'; $conn_string = "BlobEndpoint=$blob_url;\nSharedAccessSignature=$sas_token"; diff --git a/utils/load_warranty_serial/bulk_load_serials.php b/utils/load_warranty_serial/bulk_load_serials.php new file mode 100644 index 00000000..bfdd547a --- /dev/null +++ b/utils/load_warranty_serial/bulk_load_serials.php @@ -0,0 +1,187 @@ +loadEnv(__DIR__.'/../../.env'); + +$db_info = $_ENV['DATABASE_URL']; + +// sample format of db_info: mysql://db_user:db_password@127.0.0.1:3306/resq?charset=utf8 +// dsn for PDO needs to be: mysql:host=127.0.0.1:3306;dbname=resq;charset=UTF8 + +preg_match('/^mysql:\/\/(.*):(.*)@(.*):(.*)\/(.*)\?(.*)/', $db_info, $result); + +$db_type = 'mysql:host='; +$user = $result[1]; +$pass = $result[2]; +$ip_port = $result[3] . ':' . $result[4] . ';'; +$db_name = 'dbname=' . $result[5] . ';'; +$charset = $result[6]; + +$dsn = $db_type . $ip_port . $db_name . $charset; + +//error_log($dsn); +//error_log($user); +//error_log($pass); + +// connect to db +$db = new PDO($dsn, $user, $pass, array(PDO::MYSQL_ATTR_LOCAL_INFILE => true)); + +// go through rows +$source = 'motiv'; +$data_array = []; +while (($row = fgetcsv($csv)) !== false) +{ + // TODO: verify if these are still the headers if there are headers + // possible lines in output file: + // (1) header in csv file + // SerialNumber,Sku,DispatchStatus,CreatedDate,InventoryStatus,CategoryID,CategoryName + // (2) No available data + // (3) CH2000012071,WCHD23BL-CPN00-LX,0,2020-08-11 04:05:27.090,0,4,CHAMPION MF + // (4) Empty line + // (5) empty sku + + // check if No available data + if ($row[0] == 'No available data') + { + // skip the line + error_log('No available data, skipping the line...'); + continue; + } + + // check if empty line + if ($row == array(null)) + { + // skip + error_log('Skipping empty line...'); + continue; + } + + // check if empty serial + if (empty($row[0])) + { + $err_message = "Empty serial. " . "\n"; + fwrite($output_fh, $err_message); + continue; + } + + // sample of line in output file: + // serial number, sku, dispatch status, created date, inventory status, category id, category name + // CH2000012071,WCHD23BL-CPN00-LX,0,2020-08-11 04:05:27.090,0,4,CHAMPION MF + // MG2000313690,N/A,1,2021-05-14T23:47:30.6430000+08:00,0,10,GOLD + $serial = trim(strtoupper($row[0])); + $sku = trim(strtoupper($row[1])); + $dispatch_status = trim($row[2]); + $str_date_create = trim($row[3]); + $inventory_status = trim($row[4]); + $cat_id = trim($row[5]); + $cat_name = trim(strtoupper($row[6])); + + error_log('Processing ' . $serial . ' and ' . $sku); + + // since some people cannot follow simple instructions... + // check the date format on the string + // try 2021-05-15T08:35:46+08:00 format on str_date_create + $date_create = DateTime::createFromFormat('Y-m-d\TH:i:sP', $str_date_create); + + if ($date_create == false) + { + // try this format: 2021-05-15T08:47:20.3330000+08:00 + // get the date, time and timezone from str_date_create + $str_date_time = substr($str_date_create, 0, 19); + $str_timezone = substr($str_date_create, 27); + $str_datetime_tz = $str_date_time . $str_timezone; + + // create DateTime object + // sample: 2021-05-15T12:16:06+08:00 + $date_create = DateTime::createFromFormat('Y-m-d\TH:i:sP', $str_datetime_tz); + + // check if datetime object was created + // if not, someone f*cked up and we have no date create + if ($date_create == false) + { + // log the serial + $message = "$serial - ERROR - " . "Invalid date format for create date." . "\n"; + fwrite($output_fh, $message); + continue; + } + } + + $created_date = $date_create->format('Y-m-d H:i:s'); + + //error_log($str_date_time); + //error_log($str_timezone); + //error_log($str_datetime_tz); + //error_log($date_create->format('Y-m-d H:i:s')); + + $meta_info = [ + 'dispatch_status' => $dispatch_status, + 'inventory_status' => $inventory_status, + 'category_id' => $cat_id, + 'category_name' => $cat_name, + ]; + + $info = json_encode($meta_info); + + if ($sku == 'N/A') + $sku = null; + + // create data for the infile + $data_array[] = [ + $serial, + $sku, + $created_date, + $source, + $info + ]; +} + +// cache directory +$cache_dir = __DIR__ . '/../../var/cache'; + +$file = $cache_dir . '/warranty_serial_data.tab'; +error_log('opening file for warranty serial - ' . $file); + +$fp = fopen($file, 'w'); +if ($fp === false) +{ + error_log('could not open file for load data infile - ' . $file); +} +else +{ + foreach ($data_array as $key => $data) + { + $line = implode('|', $data) . "\r\n"; + fwrite($fp, $line); + } +} + +fclose($fp); + +error_log('Loading warranty serial data...'); +$db->exec('LOAD DATA LOCAL INFILE \'' . $file . '\' INTO TABLE warranty_serial FIELDS TERMINATED BY \'|\' LINES TERMINATED BY \'\\r\\n\' (id, sku, date_create, source, meta_info)'); + +// close file +fclose($csv); +fclose($output_fh); + diff --git a/utils/warranty_motiv_local_bulk.sh b/utils/warranty_motiv_local_bulk.sh index c4f2a551..cf0f11eb 100755 --- a/utils/warranty_motiv_local_bulk.sh +++ b/utils/warranty_motiv_local_bulk.sh @@ -1,40 +1,81 @@ #!/bin/bash touch /tmp/warranty_download_serial.csv -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-03-21 /tmp/warranty_download_serial.csv 1 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-04-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-05-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-06-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-07-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-08-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-09-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-10-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-11-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-12-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-13-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-14-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-15-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-16-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-17-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-18-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-19-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-20-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-21-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-22-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-23-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-24-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-25-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-26-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-27-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-28-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-29-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-30-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-31-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-01-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-02-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-03-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-04-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-05-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-06-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-07-21 /tmp/warranty_download_serial.csv 0 +/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 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-03-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-04-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-05-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-06-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-07-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-08-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-09-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-10-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-11-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-12-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-13-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-14-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-15-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-16-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-17-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-18-21 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-19-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-20-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-21-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-22-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-23-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-24-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-25-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-26-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-27-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-28-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-29-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-30-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-01-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-02-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-03-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-04-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-05-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-06-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-07-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-08-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-09-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-10-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-11-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-12-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-13-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-14-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-15-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-16-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-17-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-18-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-19-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-20-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-21-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-22-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-23-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-24-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-25-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-26-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-27-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-28-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-29-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-30-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-31-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-01-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-02-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-03-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-04-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-05-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-06-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-07-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-08-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-09-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-10-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-11-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-12-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-13-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-14-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-15-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-16-22 /tmp/warranty_download_serial.csv 0 touch /tmp/warranty_load_status.txt -/usr/bin/php /var/www/resq/utils/load_warranty_serial/load_serials.php /tmp/warranty_download_serial.csv /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 diff --git a/utils/warranty_motiv_prod_bulk.sh b/utils/warranty_motiv_prod_bulk.sh index c4f2a551..cf0f11eb 100755 --- a/utils/warranty_motiv_prod_bulk.sh +++ b/utils/warranty_motiv_prod_bulk.sh @@ -1,40 +1,81 @@ #!/bin/bash touch /tmp/warranty_download_serial.csv -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-03-21 /tmp/warranty_download_serial.csv 1 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-04-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-05-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-06-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-07-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-08-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-09-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-10-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-11-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-12-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-13-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-14-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-15-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-16-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-17-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-18-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-19-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-20-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-21-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-22-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-23-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-24-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-25-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-26-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-27-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-28-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-29-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-30-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-31-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-01-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-02-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-03-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-04-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-05-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-06-21 /tmp/warranty_download_serial.csv 0 -/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-07-21 /tmp/warranty_download_serial.csv 0 +/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 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-03-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-04-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-05-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-06-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-07-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-08-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-09-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-10-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-11-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-12-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-13-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-14-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-15-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-16-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-17-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-18-21 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-19-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-20-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-21-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-22-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-23-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-24-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-25-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-26-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-27-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-28-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-29-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 04-30-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-01-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-02-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-03-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-04-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-05-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-06-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-07-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-08-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-09-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-10-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-11-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-12-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-13-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-14-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-15-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-16-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-17-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-18-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-19-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-20-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-21-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-22-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-23-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-24-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-25-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-26-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-27-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-28-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-29-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-30-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 05-31-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-01-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-02-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-03-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-04-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-05-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-06-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-07-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-08-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-09-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-10-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-11-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-12-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-13-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-14-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-15-22 /tmp/warranty_download_serial.csv 0 +/usr/bin/php /var/www/resq/utils/get_warranty_serial/new_get_serials.php 06-16-22 /tmp/warranty_download_serial.csv 0 touch /tmp/warranty_load_status.txt -/usr/bin/php /var/www/resq/utils/load_warranty_serial/load_serials.php /tmp/warranty_download_serial.csv /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