cancel
Showing results for 
Search instead for 
Did you mean: 

Product Images Getting Auto Deleted everyday

Product Images Getting Auto Deleted everyday

Hi, 

 

On our website, Some weird thing is Happening. From Past 7 days, everyday the product images disappear for some particular sku's and when we reupload the excel file then everything works fine... Then next day again the images gets disappeared. Can anyone help us on this ?

6 REPLIES 6

Re: Product Images Getting Auto Deleted everyday

If it's automatically disappeared then maybe you should check your cron job, both on server and local install directory.

Re: Product Images Getting Auto Deleted everyday

We have checked the cron file but there is nothing suspicious that we could find. Is there anything particular that we need to change. Actually we too are surprised because there are some products only whose images gets disappeared every day. 

Re: Product Images Getting Auto Deleted everyday

Also we have checked indexer.php file (ROOT/Shell) it's looks as standard magento file.

Re: Product Images Getting Auto Deleted everyday

Hi,

 

Did you check cronjob on server too? See if there's any scripts.

Another approach is to look for a particular extension that involes to images, see if it has "delete" images option.

I've seen several extensions that clean up images, un-used images every week, so store will be clean and light weight. 

 

Best Regards,

Jimmy.

Re: Product Images Getting Auto Deleted everyday

thanks for rply,

yes we have rechecked cronjob on the server, there is no script for indexing.

 


require 'app/Mage.php';

if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

Mage::app('admin')->setUseSessionInUrl(false);

umask(0);

$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;

try {
if (stripos(PHP_OS, 'win') === false) {
$options = getopt('m::');
if (isset($options['m'])) {
if ($options['m'] == 'always') {
$cronMode = 'always';
} elseif ($options['m'] == 'default') {
$cronMode = 'default';
} else {
Mage::throwException('Unrecognized cron mode was defined');
}
} else if (!$isShellDisabled) {
$fileName = basename(__FILE__);
$baseDir = dirname(__FILE__);
shell_exec("/bin/sh $baseDir/cron.sh $fileName -mdefault 1 > /dev/null 2>&1 &");
shell_exec("/bin/sh $baseDir/cron.sh $fileName -malways 1 > /dev/null 2>&1 &");
exit;
}
}

Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
if ($isShellDisabled) {
Mage::dispatchEvent('always');
Mage::dispatchEvent('default');
} else {
Mage::dispatchEvent($cronMode);
}
} catch (Exception $e) {
Mage:Smiley TonguerintException($e);
exit(1);
}

Re: Product Images Getting Auto Deleted everyday

Any help or advise on this would be very helpful.