Posts

Showing posts from November, 2011

Maximum execution time of 60 seconds exceeded in common.inc - Drupal + Linux

When you are working on Drupal in your local installation some times you get :Fatal error: Maximum execution time of 30/60 seconds exceeded on your browser. I also got that issue and what I did, I added this code block in my settings.php. 1) open your settings.php (sites / all / default/settings.php) 2) add this code for PHP settings: line number between 147 - 168 ini_set('max_execution_time', 0);

Find all the large files on linux server - Linux

To list the files larger than 20MB use the following command in your terminal find / -name "*.gz" -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' The output will be something like this.... /home/fileName.sql.gz: 160M /var/www/fileName.tar.gz: 82M /var/www/Directory/Path/FileName.tar.gz: 82M ... .. . This will find all the gz files. To find the files of all the type, use "*" only. find / -name "*" -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Ignore or skip some tables while dumping database

To ignore some tables while backingup database use the following.. mysqldump -u dave -ppassword -h localhost --ignore-table=my_db_name.my_table_name my_db_name > dump.sql

Copying files Updated in last 21 days - Linux

Following command will copy the files, updated in last 21 days from "source" to "destination" $ pwd source $ find . -mtime -21 -type f -exec cp {} /var/www/somwhere../destination \;

Deleting Forums Using Mysql

Deleting forum from drupal, only delete terms, if you want to delete all its nodes, comments and terms from database, truncate the follwing tables from Drupal Database. truncate comments; truncate content_type_forum; truncate forum; truncate node; truncate node_revisions; truncate term_data; truncate term_hierarchy; truncate term_node; truncate users; truncate node_comment_statistics; Other Option if you want to drop all the tables at once to restore the new data drop table comments, content_type_forum, forum, node, node_revisions, term_data, term_hierarchy, term_node, users, node_comment_statistics;

Clearing Drupal Cache

Clear the following tables to clear the Drupal Cache truncate `cache`; truncate `cache_block`; truncate `cache_content`; truncate `cache_filter`; truncate `cache_form`; truncate `cache_menu`; truncate `cache_page`; truncate `cache_update`; truncate `cache_views`; truncate `cache_views_data`; truncate `watchdog`;