Cron to script without security check?

Hi,

I have a script : list_file_delete.php with security check

I want to launch this script everyday by cron, so I have created a new file script : cron_delete_file.php

This is the content of this script :

sc_apl_status('list_file_delete', 'on');
sc_redir('list_file_delete');
sc_reset_apl_status();

Do you have an idea how run this script from cron ?

I tested with curl, php, wget.

This is content of HTML page execute from cron :

<form name="Fredir" method="post"
                     target="_self">
     <input type="hidden" name="nmgp_parms" value=""/>
     <input type="hidden" name="nmgp_url_saida" value="/scriptcase/app/anva/cron_delete_file/">
     <input type="hidden" name="script_case_init" value="4615"/>
   </form>
      <SCRIPT language="javascript">
          window.onload = function(){
             submit_Fredir();
          };
          function submit_Fredir()
          {
              document.Fredir.target = "_self";
              document.Fredir.action = "/scriptcase/app/anva/list_file_delete/";
              document.Fredir.submit();
          }
      </SCRIPT>

When I execute cron by : curl http://192.168.55.100/cron_delete_file/cron_delete_file.php, it’s seem that redirect is not execute.

Do you have an another strategy ?

Thanks

Hmmmm, Lynx, curl, wget do not read javascript instruction.

My solution is not applicable, maybe duplicate initial script and rename it to cron_delete_file.php for execute with cron ?

It’s not necessary to encapsulate a PHP script into a HTML. You can put on Cron the PHP script directly. But a point to consider is, you have to uncheck the security check in order to allow cron to execute the script.

Hello,

Okay but I didn’t want to uncheck the security. If I can’t find another solution then I will have to use this method or develop a script outside of Scriptcase

Thanks

I would have liked to be able to call the protected page like this from the cron :

http://192.168.55.100/cron_delete_file/list_file_delete.php?code=password124343!$%#

But it is not possible to apply the macro sc_apl_status(‘list_file_delete’, ‘on’); on the same page.

That’s a shame

Hi,

This is my new solution :

  1. Uncheck security option
  2. Add password security (ex.: 123)
  3. Add this url to cronjob : http://192.168.55.200/scriptcase/app/anva/List_file_delete/?script_case_senha=123
  4. If I want view this page from my menu, add this url directly on entry menu.

It’s my best at this moment.

With this solution i can’t call global var.

Thanks