Пример #1
0
/*----------------------------------------------------------------------------*/
int MainService()
/*----------------------------------------------------------------------------*/
{
	BOOL flag = TRUE;

	if (flag)
	{
		GetCfg();

		int i;
		for (i=0; i < iMaxLogZip; i++)
		{
			/* Expire Time을 구한다. */
			if (flag) GetCompTime(stLogZip[i].iExpNo);

			/* Expire Time에 해당하는 폴더를 처리한다. */
			if (flag) JobProc(stLogZip[i].sObjPath);
		}
	}

	return 0;
}
Пример #2
0
void
print_list (FILE * in, int flag, int non_priv)
{
  DbCtlLimitAttr cpu_def, read_def, write_def;
  char val = 'M';
  if (flag == 1) val = 'K';
  else if ( flag == 2 ) val = ' ';
  non_priv = 1;
  if (access(CONFIG_PATH, R_OK) == 0){
	  non_priv = 0;
  }
  ReadCfg ((non_priv?DUPLICATE_CONFIG_PATH:CONFIG_PATH), "default");
  if (flag)
	 printf (" user\tcpu(%%)\tread(%cB/s)\twrite(%cB/s)\n", val, val);
  else
     printf (" user             cpu(%%)                     read(%cB/s)                        write(%cB/s)\n", val, val);
  GetDefault (GetCfg (), flag);

  DbCtlFoundTag *found_tag_ = g_ptr_array_index (GetCfg (), 0);

  strncpy (cpu_def.l_current,
	   GetLimitAttr (found_tag_->limit_attr, "cpu", "current"),
	   sizeof (cpu_def.l_current) - 1);
  strncpy (cpu_def.l_short,
	   GetLimitAttr (found_tag_->limit_attr, "cpu", "short"),
	   sizeof (cpu_def.l_short) - 1);
  strncpy (cpu_def.l_mid, GetLimitAttr (found_tag_->limit_attr, "cpu", "mid"),
	   sizeof (cpu_def.l_mid) - 1);
  strncpy (cpu_def.l_long,
	   GetLimitAttr (found_tag_->limit_attr, "cpu", "long"),
	   sizeof (cpu_def.l_long) - 1);

  strncpy (read_def.l_current,
	   GetLimitAttr (found_tag_->limit_attr, "read", "current"),
	   sizeof (read_def.l_current) - 1);
  strncpy (read_def.l_short,
	   GetLimitAttr (found_tag_->limit_attr, "read", "short"),
	   sizeof (read_def.l_short) - 1);
  strncpy (read_def.l_mid,
	   GetLimitAttr (found_tag_->limit_attr, "read", "mid"),
	   sizeof (read_def.l_mid) - 1);
  strncpy (read_def.l_long,
	   GetLimitAttr (found_tag_->limit_attr, "read", "long"),
	   sizeof (read_def.l_long) - 1);

  strncpy (write_def.l_current,
	   GetLimitAttr (found_tag_->limit_attr, "write", "current"),
	   sizeof (write_def.l_current) - 1);
  strncpy (write_def.l_short,
	   GetLimitAttr (found_tag_->limit_attr, "write", "short"),
	   sizeof (write_def.l_short) - 1);
  strncpy (write_def.l_mid,
	   GetLimitAttr (found_tag_->limit_attr, "write", "mid"),
	   sizeof (write_def.l_mid) - 1);
  strncpy (write_def.l_long,
	   GetLimitAttr (found_tag_->limit_attr, "write", "long"),
	   sizeof (write_def.l_long) - 1);
  FreeCfg ();

  DbCtlLimitAttr limit_attr_def;
  ReadCfg ((non_priv?DUPLICATE_CONFIG_PATH:CONFIG_PATH), "user");
  GPtrArray *tags = addMemoryUser (in, GetCfg ());
  GetDefaultForUsers (tags, &cpu_def, &read_def, &write_def, flag);
  FreeCfg ();
}