Posts

Spring Quartz scheduler

 Spring is bundled with a scheduler that you can configure to be used in your application. This is typically useful for daemon processes which are supposed to kick off at a certain  defined interval.  This can be very simply achieved using the SimpleTriggerFactoryBean. To create this , you would need to have the following information handy: 1. targetObject - The name of the bean referred from Spring whose method is to be invoked. 2. targetMethod - Name of the method that is to be invoked. 3. Concurrent - True or false  4. Start delay - The initial delay after daemon service start up in milliseconds. 5. Repeat interval - Time interval after which the method should be invoked repeatedly. Here is a sample code you can use to create such a daemon service . <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <bean class="java.util.ArrayList"> <constructor-arg> <list> <bean class=...

Linux file and directory listing - ls command

Linux command line prompt offers the command 'ls' to list the files and directories. More information on this command can be found using the Linux manual (man ls). Common Usages We will now see the most common usages of this command. 1. ls -lrt This happens to be the most common and frequent usage of the ls command. This provides a listing of all files and directories in an order sorted by file creation time.  2. ls -lrth You see there is a 'h' appendage here. It stands for human readable form . ls command displays the file size information in bytes by default. The 'h' makes it display in MB or GB or KB. 3. ls -la The 'a' represents all. Hidden files in linux are files which begin with a dot. The 'a' command will display all these files. LS used in pipe stream conversions Some commands in relation to 'ls' as a basic to aid in your daily use. a. Produce a count of number of files and directories. ls -l | wc -l b. Print file names without o...

Autosys - A beginners guide

AUTOSYS is a batch job scheduler and orchestration tool. It is used to execute batch jobs in a timely and organized fashion. To configure a batch in AUTOSYS , one needs to create a ".jil" file.  How to structure a JIL file Before creating your job in AUTOSYS, one should be very clear on  a. The command and hostname of unix machine for invoking batch process. b. Whether its a standalone job or is part of a series of jobs. c. Timings and Calendar considerations. d. If there is a maximum time associated with job. e. Bash profile to be used when invoking on unix or Linux system. f. Trigger conditions for the job. g. Timezone considerations if multiple regions are involved. First command in JIL instructs as to what are we trying to do. There are 3 actions here: 1. insert_job : <job name> 2. update_job : <job name> 3. delete_job : <job name> The other JIL attributes are as explained below: job type. There are again 3 types used: 1. job_type : b (BOX) 2. job_type :...

Sybase Space Checks

Schema space listing To get a schema wise listing of the space usage on Sybase database , you can use the below command. sp_dba_DBS Table wise listing To get a table wise listing of the space consumed by various tables in a DB schema , use the below query. select convert(varchar(30),o.name) as table_name, row_count(db_id(),o.id) as row_count, data_pages(db_id(),o.id, 0) as pages, data_pages(db_id(),o.id, 0) * (@@maxpagesize/1024) as kbs from sysobjects o where type = 'U' order by kbs desc Total space in schema sp_spaceused  Total space occupied by table sp_spaceused <table name> Total space occupied by table with breakup for indexes. sp_spaceused <table name> , 1