Zen Cart Logo
Forums / Customization from the Admin / looking to create godaddy cron job to clear bmz_cache

looking to create godaddy cron job to clear bmz_cache

Views: 865

Results 1 to 2 of 2
6 Jun 2012, 4:38 AM
#1
gueston avatar

gueston

Zen Follower

Join Date:
Apr 2009
Posts:
118
Plugin Contributions:
0

looking to create godaddy cron job to clear bmz_cache

Hello everyone.My english and zen cart were poor,as the tittle,i need help to create godaddy cron job clear images cache.
I used godaddy liunx hosting.zen cart 1.3.9h,i have try to use: rm /home/content/44/7523244/html/gueston/bmz_cache/? in godaddy cron job,but it don't work,so hope some one help me to write right Command or files.
Thank you very much.

6 Jun 2012, 5:12 AM
#2
gueston avatar

gueston

Zen Follower

Join Date:
Apr 2009
Posts:
118
Plugin Contributions:
0

Re: looking to create godaddy cron job to clear bmz_cache

Ok,now i found the code from DB reply now,

<?php
$thePath = './bmz_cache/0/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/1/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/2/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/3/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/4/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/5/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/6/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/7/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/8/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/9/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/a/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/b/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/c/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/d/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/e/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';
$thePath = './bmz_cache/f/';
echo '<br />Locating and deleting *.jpg and *.JPG files from this folder: ' . $thePath . '<br />';
$counter = 0;
if ($theDir = @dir($thePath)) {
  while ($theFile = $theDir->read()) {
    if (is_file($thePath . $theFile)) {
      if (preg_match('/\.jpg$/', $theFile) > 0 || preg_match('/\.JPG$/', $theFile) > 0) {
        echo '<br />Removing file: ' . $thePath . $theFile;
        unlink($thePath . $theFile);
        $counter++;
      }
    }
  }
  $theDir->close();
}
unset($theDir, $theFile);
echo ($counter == 0) ? '<br />No files found matching the criteria.' : '<br />Done';