Mage::getStoreConfig not returning updated values - magento

Recently we've noticed that Mage::getStoreConfig is not returning updated values in a app/code/local plugin. Everything was working as of last Friday so we assume that something has changed on the server.
We can see the values updating correctly in the database table core_config_data.
We have
recompiled
flushed the Magento Cache
flushed the Cache Storage
reset folder and file ownership and permissions
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
For example, we added an extra character to the store phone number, see that the database value has updated but it doesn't show with the following line
Mage::getStoreConfig('general/store_information/phone')
As a test we duplicated the site and database via Plesk and applied the latest patches to both sites. The duplicated site worked as normal.
I'm intrigued to find out what has happened so any ideas as to what the issue might be would be welcome?

Related

wrong script and syntax trouble

goal:
find all documents (texts, pdfs, fotos, etc) on my computer (located in different files) which were changed after a specific date and copy them to a different file,
that's what I typed in a terminal:
find . maxdepth 1 -newermt 2022-02-26 -exec / cp /Schreibtisch/new files after feb 28
as a response I get: missing argument for -exec
cant find the error, pls help
tx,
michael

Magento media url not working

I want to clear that I have already went through this post:
Magento media url - get rid of 403 Forbidden
but I am not still able to get image url from media library. I have tried all these URLs:
localhost/magento/media/customer/pic1.jpg (access forbidden error)
localhost/magento/media/index.html/customer/pic1.jpg (object not found error but image is present)
localhost/magento/media/index.html (working but of no use)
Correct link is localhost/magento/media/customer/pic1.jpg.
Try to set correct files ownership and permissions.
For apache2 server default configuration:
chown -R www-data:www-data /var/www/html/magento
find /var/www/html/magento/media/ -type f -exec chmod 600 {} \;
find /var/www/html/magento/media/ -type d -exec chmod 700 {} \;
I have to make a index.html and .htaccess file same as media folder(as in my referenced link) and to place in media/customer too. it has been fixed now and working with url : localhost/magento/media/customer/pic1.jpg.

Delete all product images in magento

I uploaded a product image in magento but found out it was no good. So I deleted it and uploaded another image with the same name. Now I get a _1 after the name of the image. Of course this occurs when a image already exists.
Does anybody now how I can delete all product images?
Well, if you want to get rid of the image files for products, you need to go to your server (by ssh / ftp or some cPanel) and delete all contents of /media/catalog/product. Using ssh you should do this that way:
ssh login#host [-p {port} # only if it's not 22 which is default, often it's also 2222 or 2223]
cd /path/to/your/magento/root
rm -rf /media/catalog/product/*
But have in mind that it will delete ALL product images in your Magento instance and may cause errors if some of this files are set as your current product images.
You need to remove them in two places to avoid errors. Note, the following will remove ALL images from all your products. Please backup before.
First, you need to remove them from the database. You can do this by issuing the following in phpMyAdmin or however you choose:
TRUNCATE TABLE `catalog_product_entity_media_gallery`
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`
Second, remove your media/catalog folder. With SSH, you would use:
rm -rf media/catalog
rm -rf media/tmp
rm -rf media/import (if you used an import process for your images with your products).
Try this extension
http://www.magentocommerce.com/magento-connect/image-clean.html
On sites with large product count it work slowly, but you can delete images from hard disk (those images, that have been deleted in Magento).
Remove the file from
media/catalog/product/
media/tmp/catalog/product/
clear cache

Finding the files which are not accessed/modified in last 30min?

I've one requirement, i want to give the notifications to the users who have not accessed the files in 30 min. using the shell script. Is it possible to find the files which was not accessed in 30 min using find. I'd checked.
find /opt/SP/tibmft/scripts/ -mtime 0
which will fetch the files which was modifed in last 24 hours.
My requirement is fetch the files which was created in the last 30 min and not been accessed by the user? Please suggest the solution, how to achieve this?
Try using
find PATH -cmin -30 -and -amin +30
Is it possible to find the files which was not accessed in 30 min using find.
According to man find:
Numeric arguments can be specified as
+n for greater than n,
-n for less than n,
n for exactly n.
Please note, this is greater and less not greater/less or equal. So, you have to take some care in order to not have a 1 minute error due to that:
find PATH -not -amin +30
or
find PATH -amin -31
My requirement is fetch the files which was created in the last 30 min and not been accessed by the user?
Here is an attempt:
find PATH -amin -31 -not -newerBt "-30 minutes"
# ^^^^^^^^
# (B)irth date newer (t)han ...
... unfortunately, it does not work on my computer with ext4 file-system, as, to quote a comment by Barmar above: "Most Unix file-systems don't record file creation time. They just have modification, access, and inode change times."
Some random ideas:
According to one of your comment, this is potentially a periodic task. So one might investigate the use of a cron job to record the list of files at regular intervals?
If your file-system has snapshots you might build on that too. Maybe.
Try the following:
find $PATH -type f -cmin -30 amin +30

Find directories created less than a week ago

I know I can use this command to find directories created or modified less than a week ago:
find /home -type d -mtime -7
But how do I find directory that were created less than a week ago?
Creation time is not stored.
There is only 3 timestamps you can check
Last access time
Last modification time
Last change time
"Change" is one of: permission changes, rename etc.
While the modification is contents only.
Short answer: you can't.
There are three times stored in an inode
ctime: time of creation or change of the inode
mtime: time of last change of the file that the inode refers to
atime: time of last access to the file
The point is: ctime is altered not only by create, but also by chmod / chown, maybe even by ln (not sure). Man stat and man touch are your friends.
If you try to find fresh directories by means of find /home -type d -mtime -7 be prepared to also find older directories that had their mode or owner changed.

Resources