Categories
Magento

Get BaseURLs from Database via CLI – Magento

Login to MySQL root or limited user, then use the database:-

use the-d2.com_db;

MariaDB > select * from core_config_data where path like '%base%url%';
+-----------+---------+----------+-----------------------------+------------------------------------------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+-----------------------------+------------------------------------------+
| 52 | default | 0 | web/unsecure/base_url | https://www.the-d2.com/ |
| 53 | default | 0 | web/unsecure/base_link_url | {{unsecure_base_url}} |
| 54 | default | 0 | web/unsecure/base_skin_url | {{unsecure_base_url}}skin/ |
| 55 | default | 0 | web/unsecure/base_media_url | {{unsecure_base_url}}media/ |
| 56 | default | 0 | web/unsecure/base_js_url | {{unsecure_base_url}}js/ |
| 57 | default | 0 | web/secure/base_url | https://www.the-d2.com/ |
| 58 | default | 0 | web/secure/base_link_url | {{secure_base_url}} |
| 59 | default | 0 | web/secure/base_skin_url | https://the-d2.com/the-d2image/skin/ |
| 60 | default | 0 | web/secure/base_media_url | https://the-d2.com/the-d2image/media/ |
| 61 | default | 0 | web/secure/base_js_url | https://the-d2.com/the-d2image/js/ |
| 855 | default | 0 | system/mgt_base/feed_url | https://www.the-d2.com/feed |
+-----------+---------+----------+-----------------------------+------------------------------------------+
11 rows in set (0.00 sec)

 

Categories
Uncategorized

How to delete Magento session_ files older than 30 days with cron

Manual command (in screen)
find /home/the-d2.com/public_html/var/session/ -type f -name "sess*" -mtime +30 -exec rm -f {} \; >/dev/null 2>&1
Cron
0 0 * * * find /home/the-d2.com/public_html/var/session/ -type f -name "sess*" -mtime +30 -exec rm -f {} \; >/dev/null 2>&1

Categories
Uncategorized

How to check Magento version

cd /home/the-d2.com/public_html
php -r "require 'app/Mage.php'; echo Mage::getVersion(); "