Run function on settings save

I’m not familiar with wordpress settings api but I know those options generated by settings api are handled/saved in wp-admin/options.php

Unfortunately,

if ( isset( $_POST[ $option ] ) ) {
        $value = $_POST[ $option ];
    if ( ! is_array( $value ) )
        $value = trim( $value );
    $value = stripslashes_deep( $value );
}
update_option( $option, $value );

as you can see, no hook before update_option.

But there is a workaround:

add_settings_field('..','..','callback');

function callback(){
   if($_GET['settings-updated']=='true'){
        //do your cron update stuff here.
   }
   echo 'output <input or something';
}

Not very elegant though.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)