Take backup of scripts listed in crontab

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Take backup of scripts listed in crontab
# 1  
Old 04-20-2015
Take backup of scripts listed in crontab


I'm trying to take backups of script files listed in cron tab

but,my cron entry has value like this
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
00,15,30,45 * * * * /opt/EABcsConfig/bin/metacheck.ksh   
00,15,30,45 * * * * /opt/EABcsConfig/bin/check_zfs_pool.ksh   
0 03 * * 2 /opt/EABcsConfig/bin/scrub_zfs_pool.ksh   
00 2 * * * /opt/EABcsutls/backup/backup.sh   
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/EABaircfg/bin/psrbind AirXmlRpcIf 14,15   
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/EABfds/bin/fdscorecleaner >>/dev/null   
52 * * * * /opt/EABfds/bin/configurationBackup.pl >>/dev/null   
5,15,25,35,45,55 * * * * /scripts/air_traffic_check.sh > /dev/null 2>&1
10 * * * * /scripts/air_hc.sh > /dev/null 2>&1
05 0 * * * perl /scripts/GNOCAutomation/scripts/calculate_airlookups.pl>/dev/null
15 0 * * * perl /scripts/GNOCAutomation/scripts/airEastNewSec.pl>/dev/null
30 0 * * * perl /scripts/GNOCAutomation/scripts/utilWriter.pl>/dev/null
0 * * * * perl /scripts/GNOCAutomation/scripts/resource_utilization.pl > /dev/null
0,10,20,30,40,50 * * * * /usr/lib/sa/sa1
00 8 * * * /usr/lib/sa/sa2 -A
#0,10,20,30,40,50 * * * * /opt/temp/mv_sec_prim
0,5,10,15,20,25,30,35,40,45,50,55   * * * *   su - root -c "/scripts/java_memory_usage.sh" >>/dev/null
00 6 * * *  su - root -c "/var/opt/script/TraceRemover/DeleteTrace.sh" > /dev/null 2>&1
0,10,20,30,40,50 * * * *  su - root -c "/var/opt/script/MoveDR/mv_sec_prim.sh" > /dev/null 2>&1
#00 5 * * * /scripts/old_stat_removal.sh 
00 * * * * sh /export/home/etigers/script_new/netstat_script.sh
0 5 * * * /opt/temp/air_backup.sh

which are unable to distinguished by any specific delimeter like cut -d " " -f6.

I hope a line by line parsing and printing only will help.please help me out how to take it

Advance thanks


Last edited by Corona688; 04-20-2015 at 04:40 PM.. Reason: typo
# 2  
Old 04-20-2015
crontab -l | while read -r A B C D E F
        printf "%s\n" "$F"

Though I'm wondering, why not just save the times with it? They are probably relevant too.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Backup of crontab itself

Hi all What is the best way of making backups (daily or week basis) of a crontab file? Scenario: one userid, acessed by a number of analysts, that has a crontab file contantly updated. It's a large file, with hundreds of entries. Sometimes somebody deletes an entry that shoudn't be deleted.... (2 Replies)
Discussion started by: kzpchn
2 Replies

2. UNIX for Dummies Questions & Answers

Help with Crontab and Scripts

I'm trying to create a crontab that runs every hour and runs a script in my $HOME/bin directory. Everytime it goes to run it I get this mail. Message 14: From root@xx.xxxx.edu Thu Apr 12 14:03:01 2012 Return-Path: <root@xx.xxxx.edu> X-Original-To: bbowers Delivered-To:... (4 Replies)
Discussion started by: bbowers
4 Replies

3. Solaris

Automatic backup through DD and crontab

Hi, I have not been working with Solaris for more than 10 years ago. Many things and details have ben forgotten. Hopes that some could help me with the problem. We used this scripts (below) for daily backup. The problems is following: I want to backup all partions/slice on a specific... (4 Replies)
Discussion started by: gjh
4 Replies

4. AIX

about backup with crontab

dear all! i'm a newbie to this forum as well as aix. i'm using aix version 6.1 by ssh remote with no GUI. i'm using crontab for scheduling backup with "backup" command too. i've created an entry in crontab file to backup some files daily. everything works well. but i've got a question: how can... (8 Replies)
Discussion started by: unknown_man
8 Replies

5. Shell Programming and Scripting

Scripts not nunning in CRONTAB

hi, i need to run one script in cron... in that script has connect antoher server and doing sftp for file transfer to another script. and going to be run another script in another server ssh ravikus\@server2 /export/home/ravikus/scripts/GetDetailsC2b.sh it is work fine when i run... (6 Replies)
Discussion started by: rsivasan
6 Replies

6. Shell Programming and Scripting

Backup/restore scripts

hi people i am in need of some assistance here hoping to star a linux course in january to wanted to get some experiance before starting so got a hold of some old assessments from a mate at college so just working through them in my spare time for the past 8 weeks or so and this is the final ? that... (2 Replies)
Discussion started by: boabbyrab
2 Replies

7. Shell Programming and Scripting

daily backup scripts.....

I want a script which zip the file older than 15 days and move the file to a particular folder...... That script want to run daily.......... Please provide me the script for doing that.....I am very poor in scripting.... (1 Reply)
Discussion started by: jayaramanit
1 Replies

8. UNIX Desktop Questions & Answers

audit to crontab scripts

hi, I have scripts which are running every 3 minutes. The scripts include connection to a database, using sqlplus. Sometimes, the connection fails (invalid username or password, locked user etc..) and the connection returns the error code, to the unix screen or to a file. I want whenever there's... (2 Replies)
Discussion started by: krem
2 Replies

9. HP-UX

CVSWeb - Directories listed but files not listed

I am using CVSWeb on HPUnix. When i access it, all directories are listed but files are not listed. I am getting the error "NOTE: There are 51 files, but none matches the current tag. " in tomcat sevrer log i am getting the message "rlog warning: Missing revision or branch number after -r"... (0 Replies)
Discussion started by: ganesh
0 Replies

10. UNIX for Dummies Questions & Answers

Crontab backup

I have three users on my server a) root b) oracle c) download i want to take backup of cron for everyuser everyday. Is there any way to schedule this process. (4 Replies)
Discussion started by: blackeyed
4 Replies
Login or Register to Ask a Question

Featured Tech Videos