How to add a cron task I am new to drupal, now I have function get_node_from_rss() which the file is inside mysite\sites\all\modules\node\node_rss\node_from_rss.module the function will update node from the rss link every 1 hour. Now, I dun know how to make this function add to the cron task. Can I run it without using cron.php? I search in google, they something like simple change the function name like get_node_from_rss_cron(), I also putting some code like:

$interval = variable_get('get_node_from_rss_interval', 60 * 60);
if (time() &gt;= variable_get('get_node_from_rss_next_execution', 0)) {
   watchdog('get_node_from_rss', 'get_node_from_rss ran');
   if (!empty($GLOBALS['wowfi_locamusic_addnode_show_status_message'])) {
     drupal_set_message(t('wowfi_locamusic_addnode executed at %time', array('%time' =&gt; date_iso8601(time(0)))));
     drupal_set_message(t('wowfi_locamusic_addnode executed at %time', array('%time' =&gt; date_iso8601(time(0)))));
    }
    variable_set('wowfi_locamusic_addnode_next_execution', time() + $interval);
  }


inside my code, but those still not working for me,
Any solution?
A hook implementation is simply a my_module_name_function implentation. 
Your module's internal name is what you have used in the .module file's name. 

So for in this case, it's node_from_rss (I'd recommend you to rename the folder name to node_from_rss as well so it reduces any confusion). 

If you rename your cron function to comply with the above my_module_name_function pattern, function name has to be node_from_rss_cron

function node_from_rss_cron() {
 $interval = variable_get('get_node_from_rss_interval', 60 * 60);
 if (time() &gt;= variable_get('get_node_from_rss_next_execution', 0)) {
   watchdog('get_node_from_rss', 'get_node_from_rss ran');
   if (!empty($GLOBALS['wowfi_locamusic_addnode_show_status_message'])) {
     drupal_set_message(t('wowfi_locamusic_addnode executed at %time', array('%time' =&gt; date_iso8601(time(0)))));
     drupal_set_message(t('wowfi_locamusic_addnode executed at %time', array('%time' =&gt; date_iso8601(time(0)))));
    }
    variable_set('wowfi_locamusic_addnode_next_execution', time() + $interval);
  }
}


Other than these changes, here are some of the Drupal best practices. 

Drupal 7 has a REQUEST_TIME constant defined at the beginning of page processing. If this code is for D7, use it instead of time(). 

drupal_set_message() function sets a message to the screen. but cron functions will run without use interaction. You will not see this message unless you are running cron manually at admin/reports/status page.

Avoid placing folders such as 'node' inside sites/all/modules folder. Technically it's completely ok to do so. But I think it will confuse you and others in the long run. Usually we place modules like:

sites/all/modules/MY_MODULE/MY_MODULE.module