loop script in python and bash shell script

Closed

Description

this is a request for two separate scripts that perform the same function.

the first is to be developed in python and the second in ksh compatible shell

script. Minimum scripts compatibility python version 2.6.1 and ksh shell.

both of the scripts should have the same functions and features.

the required features are:

- the scripts will be running on linux or freebsd OS

- define the work path: work at a given directory path, for example: /foo/bar/my/app/data.

the path in question has directories that are named in date format, for example: /foo/bar/my/app/data/201610

- the folder name string (the date format) may vary, additional information will be provided.

- the work path may contain other folders with different names.

- the script should identify the 3 latest directories, for example:

/foo/bar/my/app/data/201610

/foo/bar/my/app/data/201609

/foo/bar/my/app/data/201608

for each of the three identified directories, a set of commands will be issued. for example:

- "ls -l"

- "du"

- "ls -l > [url removed, login to view]"

these commands to be executed, should be executed from the shell so python can no execute own functions but has to leverage the shell.

- the script should identify the 12 latest directories, for example:

/foo/bar/my/app/data/201610

/foo/bar/my/app/data/201609

/foo/bar/my/app/data/201607

/foo/bar/my/app/data/201606

/foo/bar/my/app/data/201605

/foo/bar/my/app/data/201604

/foo/bar/my/app/data/201603

/foo/bar/my/app/data/201602

/foo/bar/my/app/data/201601

/foo/bar/my/app/data/201512

/foo/bar/my/app/data/201511

/foo/bar/my/app/data/201510

for each of the identified directories, a set of commands will be issued. for example:

- "ls -l"

- "du"

- "ls -l > [url removed, login to view]"

these commands to be executed, should be executed from the shell so python can no execute own functions but has to leverage the shell.

- all events and actions performed by the scripts should be logged

- in an event of failure at any stage, the scripts should send and email to specified email address with the failure and a copy of the log that the script has generated as an attachement.

Skills: Python, Shell Script, Software Architecture

See more: bash python script convert, bash python loop, python loop script, linux admin script shell bash, software write mq4, software write chip epson, useful software write book, software write web specs, free software write user guide, software write edid, free software write company profile, software write websites idea, software write book images, software write books, software write protection, images loop script, free software write book, mysql loop script, python scrape script, software write book, scrolling image loop script, script votes automatically different, bash ftp upload script, shell bash keywords, php loop script

Project ID: #11731274