Crontab Code Generator

Written by BinnyVA on June 22, 2009 – 11:39 pm -

Time

JSL Crontab Generator is a GUI application that can be used to create new crontab entries easily. Its a Javascript application – so it will run from your browser – there is no download/install involved. This was created as a demo for my JSL Javascript Library.

crontab syntax

Each line in a crontab file is a job and follows a particular format as a series of fields, separated by spaces or tabs(see example below). Each field can have a single value or a series of values.

crontab Operators

There are multiple ways of specifying several date/time values in a field:

  • The comma(,) specifies a list of values, for example: “1,3,4,7,8”
  • The dash(-) specifies a range. Example: “1-6”, which is equivalent to “1,2,3,4,5,6”
  • The asterisk(*) operator specifies all possible values for a field. For example, an asterisk in the hour time field would be the same as ‘every hour’.

There is also an operator which some extended versions of cron support, the slash(/) operator, which can be used to skip a given number of values. For example, “*/3” in the hour time field is equivalent to “0,3,6,9,12,15,18,21”. So “*” specifies ‘every hour’ but the “*/3” means only those hours divisible by 3.

Example: the following will clear the Apache error log at one minute past midnight each day.

    01 00 * * * echo "" > /www/apache/logs/error_log

Fields

 .---------------- minute (0 - 59) 
 |  .------------- hour (0 - 23)
 |  |  .---------- day of month (1 - 31)
 |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ... 
 |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat 
 |  |  |  |  |
 *  *  *  *  *  <command to be executed>
 

For more information about the cron and crontab, run the command man cron and man crontab.

Javascript Crontab Code Generator

You can use this tool to generate the crontab commands easily. Just enter the command and the intervals it should be executed on – this tool will create a line in crontab syntax that will do the work for you. All you have to do is add the generated line to your crontab file. Once the result line is generated, run the command ‘crontab -e’ – this will open your crontab file in an editor. Just copy the generated line into this editor and save the file – you are done.

Apache Example

For example, lets say you want to clear the apache log file every day at midnight. The command to be executed is…

echo "" > /www/apache/logs/error_log

Enter that command into the command input field in the application. Next click on the ‘Choose’ radio button in the minute and set it to 0. Then select the ‘Choose’ option in Hour and set it to 12 Midnight. Live the rest as it it – we want the command to be executed every day. Now just click on the ‘Create Crontab Line’. The final crontab line will show up in the ‘Result crontab Line’ textarea.

JSL Crontab Generator


Tags: , , , , ,
Posted in Applications, Tools | 5 Comments »

Frees – Hard Disk Drives Free Space Viewer

Written by BinnyVA on April 6, 2008 – 1:43 am -

I am taking a break from the regular MP3 Players Series for a special announcement. The first stable version of Frees has been released. Frees is a GUI tool that shows the Hard Disk space usage. It is written in Python using the GTK2 framework. This will only work in linux as it depends on the ‘df’ command. Frees just parses the output of df and shows it in a graphical format.

Download

Frees Screenshot

Features

Simple/Easy to use

Frees features a very simple interface. Granted, some of the columns like Device, Type and Mount Point may sound a bit geeky – but hey, you are using Linux. Its supposed to be geeky.

Ability to Remove Drives from the List

There may be some drives that you want to hide in the list. Like, say you have a 10 mb /boot partition – you have no user-level use for that. In Frees you can hide that partition in the list. Go to Preferences > Drives and check off the drive you want to hide.

Shows Total Space

The last item in the list is the ‘Total’ row. It shows the total space of your harddisk. Note that this shows the total of all mounted drives – so it may not be an accurate measure of your total HDD space.

Competition

KDiskFree

There is an alternative to this program – KDiskFree. Its a KDE App…

KDiskFree displays the available file devices (hard drive partitions, floppy and CD drives, etc.) along with information on their capacity, free space, type and mount point. It also allows you to mount and unmount drives and view them in a file manager.

I was not all that satisfied with KDiskFree – that’s why I created Frees. These are the advantages Frees has over KDiskFree…

  • KDiskFree cannot hide drives in the list.
  • KDiskFree includes mounted images, CD ROM/DVD ROM devices as list items. Frees ignores these items.
  • KDiskFree does not show the file system types for all drives – many are shown as ‘?’
  • Frees have the ‘Total HDD Space’ feature – KDiskFree does not have that.

But KDiskFree has one advantage over Frees – you can mount drives from within the application. You cannot do that in Frees.

df Command

The other alternative to Frees is the ‘df’ command. Here is the man entry for df…

df displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown.

df is not ‘user friendly’ in the classical sense of the term – its a terminal application. Unlike KDiskFree, I do not consider df to be a competition to Frees. As a matter of fact, Frees uses df command internally to get the space usage data.

Frees Links

Now, your job is to download this application and try it out. Send me any bugs you find and your suggestions.


Tags: , , , , , , , , ,
Posted in Applications, Gnome, News | 5 Comments »

Exaile – Music Player for Gtk+

Written by BinnyVA on January 7, 2008 – 11:12 pm -

Exaile Logo

Exaile an amarok clone for Gnome – and I have to admit – I am impressed.

Exaile is a music player aiming to be similar to KDE’s Amarok, but for GTK+ and written in Python. It incorporates many of the cool things from Amarok (and other media players) like automatic fetching of album art, handling of large libraries, lyrics fetching, artist/album information via Wikipedia, Last.fm submission support, and optional iPod support via a plugin.

Exaile Screenshot

Features

It has many features that make amarok great…

  • Automatic fetching of album art
  • Handling large music libraries
  • Lyrics fetching
  • Fetches Artist/Album information from Wikipedia

And some features that amarok does not have…

  • Tabbed playlist interface
  • Song Blacklist Manager

Disadvantages

  • I could not find the Global Hotkeys feature

Download

If you want to try exaile, you can download exaile and install it yourself.

Related Links


Tags: , , , , , , ,
Posted in Applications, Audio, Gnome | 8 Comments »