Bug 135652 - Please don't strip comments
Summary: Please don't strip comments
Status: RESOLVED FIXED
Alias: None
Product: kcron
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Nicolas Ternisien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-14 21:48 UTC by David Liontooth
Modified: 2008-03-18 23:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Liontooth 2006-10-14 21:48:53 UTC
Version:           3.5.5 (using KDE 3.5.5, Debian Package 4:3.5.5a-1 (testing/unstable))
Compiler:          Target: x86_64-linux-gnu
OS:                Linux (x86_64) release 2.6.18

In a complex crontab, it's often useful to have comments. cron allows any number of comment lines, while kcron strips all comments except the single line before a cronjob. kcron also rewrites the order of the jobs.

Please don't strip the additional comments, and please don't rearrange the order of the jobs. If kcron only wants to display the jobs and the immediately preceding comment line, that's ok, but don't mess up the file. Other users may access the file with a text editor.

For instance, here's part of a crontab with additional comments:

# Avoid using colons, apostrophes, ampersands, and slashes in titles
# -- they make searching the text a hassle later
#
#### PATH AND MAIL INFORMATION ####################################
#
# Folders to search for program files.
PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Email output to specified account -- use a comma between accounts, e.g., tna,joe
# An e-mail is sent by default to user tna -- suppress with >/dev/null 2>&1
#MAILTO=rose@one.org
#
## Cron syntax
#
# m h  dom mon dow   command
#
#### WEEKDAYS #####################################################
#
## 2AM
## 3AM
#
# Move CNN files from esteve to chianti
0 3 * * 1,2,3,4,5    rsync-esteve
#
## 4AM
#
# Move CNN files from prato to chianti
0 3 * * 1,2,3,4,5    rsync-prato
#
## 5AM
#
# CNN at 5am (prato)
#\0 5 * * 1,2,3,4,5      channel 57, 60min, "Early AM News", 4
#
## 6AM
#
# CNN at 6am (prato)
#\0 6 * * 1,2,3,4,5      channel 57, 60min, "Early AM News", 4
#
## 7AM
#
# KCBS 2 CBS News at 7am
0 7 * * 1,2,3,4,5       channel 2, 60min, "CBS Early Show", 1
# KNBC 4 NBC News at 7am
0 7 * * 1,2,3,4,5       channel 4, 60min, "Today Show", 2
# KABC 7 ABC News at 7am
0 7 * * 1,2,3,4,5       channel 7, 60min, "Good Morning America", 3
# CNN at 7am (prato)
#\0 7 * * 1,2,3,4,5       channel 57, 60min, "Newsroom", 4
# FOX 60 FOX News at 7am (prato)
#\0 7 * * 1,2,3,4,5       channel 60, 60min, "Fox News Live", 5
#
## 8AM
#
# KABC 7 ABC News at 8am
0 8 * * 1,2,3,4,5       channel 7, 60min, "Good Morning America", 1
# KCBS 2 CBS News at 8am
0 8 * * 1,2,3,4,5       channel 2, 60min, "CBS Early Show", 2
# KNBC 4 News at 8am
0 8 * * 1,2,3,4,5       channel 4, 60min, "Today Show ", 3
# CNN at 8am (prato)
#\0 8 * * 1,2,3,4,5       channel 57, 60min, "Newsroom", 4
# FOX 60 FOX News at 8am (prato)
#\0 8 * * 1,2,3,4,5       channel 60, 60min, "Fox News Live", 5
#
## 9AM
#
# KABC 7 ABC News at 9am
0 9 * * 1,2,3,4,5       channel 7, 60min, "Regis and Kelly", 1
# KNBC Channel 4 News at 9am
0 9 * * 1,2,3,4,5       channel 4, 30min, "Today Show", 2
# CNN at 9am (prato)
#\0 9 * * 1,2,3,4,5       channel 57, 60min, "Your World Today", 4
# FOX 60 FOX News at 9am (prato)
#\0 9 * * 1,2,3,4,5       channel 60, 60min, "Fox Online", 5
#
## 10AM
#
# KABC 7 ABC News at 10am
0 10 * * 1,2,3,4,5      channel 7, 60min, "The View", 1
# KTLA 5 News at 10am
0 10 * * 1,2,3,4,5      channel 5, 60min, "Jerry Springer Show", 3
# CNN at 10am (prato)
#\0 10 * * 1,2,3,4,5      channel 57, 60min, "Newsroom", 4
# MSNBC 61 News at 10am (prato)
#\0 10 * * 1,2,3,4,5      channel 61, 60min, "News Live", 5
#
## 11AM
#
# CNN at 11am (esteve)
#\0 11 * * 1,2,3,4,5      channel 57, 60min, "Newsroom ", 4
# KABC 7 ABC News at 11am
0 11 * * 1,2,3,4,5      channel 7, 60min, "Midday News", 1
# KCBS 2 CBS News at 11am
0 11 * * 1,2,3,4,5      channel 2, 30min, "Midday News", 2
# KNBC Channel 4 News at 11am
0 11 * * 1,2,3,4,5      channel 4, 60min, "Midday News", 3
# KTTV Fox 11 News at 11am (prato)
#\0 11 * * 1,2,3,4,5      channel 11, 60min, "Montel Williams Show", 4
# MSNBC 61 News at 11am (prato)
#\0 11 * * 1,2,3,4,5      channel 61, 60min, "News Live", 5
#
## NOON
#
# CNN at noon (prato)
#\0 12 * * 1,2,3,4,5      channel 57, 60min, "Newsroom", 4
#
## 1PM
#
# CNN at 1pm (prato)
#\0 13 * * 1,2,3,4,5      channel 57, 60min, "Situation Room", 4
# MSNBC 61 Tucker at 1pm (prato)
#\0 13 * * 1,2,3,4,5      channel 61, 60min, "Tucker Carlson", 5
#
## 2PM
#
# CNN at 2pm (prato)
#\0 14 * * 1,2,3,4,5      channel 57, 60min, "Situation Room", 4
#
## 3PM
#
# KABC 7 Oprah at 3pm
0 15 * * 1,2,3,4,5       channel 7, 60min, "Oprah", 1
# KCAL 9 News at 3:30pm
29 15 * * 1,2,3,4,5      channel 9, 30min, "Inside Edition", 3
# CNN at 3pm (prato)
#\0 14 * * 1,2,3,4,5       channel 57, 60min, "Lou Dobbs Tonight", 4
# FOX 60 FOX News at 3pm (prato)
#\0 15 * * 1,2,3,4,5       channel 60, 60min, "Special Report with Brit Hume", 5
#
## 4PM
#
# KABC 7 ABC News at 4pm
0 16 * * 1,2,3,4,5       channel 7, 60min, "News at 4pm", 1
# KCAL 9 News at 4pm
0 16 * * 1,2,3,4,5      channel 9, 30min, "News at 4pm", 2
# KNBC Channel 4 News at 4pm
0 16 * * 1,2,3,4,5      channel 4, 60min, "News at 4pm", 3
# CNN at 4pm (prato)
#\0 16 * * 1,2,3,4,5      channel 57, 60min, "Situation Room", 4
# FOX 60 FOX News at 4pm (prato)
#\0 16 * * 1,2,3,4,5       channel 60, 60min, "Report with Shepard Smith", 5
#
## 5PM
#
# CNN at 5pm (esteve)
#\0 17 * * 1,2,3,4,5      channel 57, 60min, "Paula Zahn NOW", 4
# KABC 7 Eyewitness News at 5pm
0 17 * * 1,2,3,4,5      channel 7, 60min, "News at 5PM", 1
# KCBS 2 CBS News at 5pm
0 17 * * 1,2,3,4,5      channel 2, 60min, "News at 5pm", 2
# KCET 8 BBC World News at 5pm
0 17 * * 1,2,3,4,5      channel 8, 30min, "BBC World News", 3
# KCET 8 Nightly Business Report at 5:30pm
30 17 * * 1,2,3,4,5      channel 8, 30min, "Nightly Business Report", 3
# KNBC Channel 4 News at 5pm (prato)
#\0 17 * * 1,2,3,4,5      channel 4, 60min, "News at 5pm", 4
# FOX 60 The O'Reilly Factor at 5pm (prato)
#\0 17 * * 1,2,3,4,5      channel 60, 60min, "The OReilly Factor", 5
#
## 6PM
#
# CNN at 6pm (esteve)
#\0 18 * * 1,2,3,4,5      channel 57, 60min, "Larry King Live", 4
# KABC 7 Eyewitness News at 6pm
0 18 * * 1,2,3,4,5      channel 7, 30min, "News at 6PM", 1
# KABC 7 ABC's World News With Charles Gibson at 6:30pm
30 18 * * 1,2,3,4,5      channel 7, 30min, "World News Tonight", 1
# KCBS 2 News at 6pm
0 18 * * 1,2,3,4,5      channel 2, 30min, "News at 6pm", 2
# KCBS 2 CBS News at 6:30pm
30 18 * * 1,2,3,4,5      channel 2, 30min, "CBS Evening News", 2
# KCET 8 PBS News at 6:30pm
30 18 * * 1,2,3,4,5      channel 8, 30min, "Life and Times", 3
# KNBC Channel 4 News at 6pm (prato)
#\0 18 * * 1,2,3,4,5      channel 4, 30min, "News at 6pm", 4
# KNBC Channel 4 News at 6pm (prato)
#\30 18 * * 1,2,3,4,5      channel 4, 30min, "NBC Nightly News", 4
# FOX 60 FOX News at 6pm (prato)
#\0 18 * * 1,2,3,4,5       channel 60, 60min, "Hannity and Colmes", 5
# MSNBC 61 Scarborough Country at 6pm (esteve)
#\0 1 * * 1,2,3,4,5       channel 61, 60min, "Scarborough Country", 5
#
## 7PM
#
# KCBS 2 CBS News at 7pm
0 19 * * 1,2,3,4,5       channel 2, 30min, "Entertainment Tonight", 1
# KCBS 2 CBS News at 7pm
30 19 * * 1,2,3,4,5      channel 2, 30min, "The Insider", 1
# KCET 8 Newshour with Jim Lehrer
0 19 * * 1,2,3,4,5       channel 8, 60min, "Newshour with Jim Lehrer", 2
# KNBC 4 EXTRA at 7pm
0 19 * * 1,2,3,4,5       channel 4, 30min, "EXTRA at 7pm", 3
# KNBC 4 Access Hollywood at 7pm
30 19 * * 1,2,3,4,5      channel 4, 30min, "Access Hollywood", 3
# CNN at 7pm (prato)
#\0 19 * * 1,2,3,4,5      channel 57, 60min, "Anderson Cooper 360", 4
# FOX 60 On the Record With Greta Van Susteren at 7pm (prato)
#\0 19 * * 1,2,3,4,5       channel 60, 60min, "On the Record with Greta", 5
#
## 8PM
#
# CNN at 8pm (prato)
#\0 20 * * 1,2,3,4,5      channel 57, 60min, "Anderson Cooper 360", 4
# KCAL 9 News at 8pm (prato)
#\0 20 * * 1,2,3,4,5    channel 9, 60min, "News at 8pm", 5
#
## 9PM
#
# KCET 8 Frontline (Tuesdays) (prato)
#\0 21 * * 2   channel 8, 60min, "Frontline", 4
# MSNBC 61 Countdown w/ Keith Olbermann at 9pm (prato)
#\0 21 * * 1,2,3,4,5       channel 61, 60min, "Countdown with Keith Olbermann", 5
#
## 10PM
#
# KNBC 4 at 10pm (Wednesdays)
0 22 * * 3     channel 4, 60min, "Dateline NBC", 1
# KABC 7 News at 10pm (Thursdays)
0 22 * * 4     channel 7, 60min, "Prime Time", 1
# KABC 7 News at 10pm (Fridays)
0 22 * * 5     channel 7, 60min, "20-20", 1
# KTLA 5 Prime News at 10pm
0 22 * * 1,2,3,4,5      channel 5, 60min, "Prime News at 10pm", 3
# KTTV Fox 11 Ten O'Clock News (prato)
#\0 22 * * 1,2,3,4,5      channel 11, 60min, "Ten OClock News", 4
# CC 76 Daily Show with John Stewart at 10pm (Mon-Thur) (prato)
#\0 22 * * 1,2,3,4      channel 76, 30min, "Daily Show", 5
# CC 76 Colbert Report at 10pm (Mon-Thur) (prato)
#\30 22 * * 1,2,3,4      channel 76, 30min, "Colbert Report", 5
#
## 11PM
#
# KABC 7 Eyewitness News at 11pm
0 23 * * 1,2,3,4,5     channel 7, 35min, "Late News", 1
# KABC 7 Nightline at 11:35PM
35 23 * * 1,2,3,4,5     channel 7, 31min, "Nightline", 1
# KCBS 2 CBS News at 11pm
0 23 * * 1,2,3,4,5      channel 2, 35min, "Late News", 3
# KCBS 2 Late Show Letterman at 11:35pm
35 23 * * 1,2,3,4,5      channel 2, 62min, "Late Show with Dave Letterman", 3
# KCET 8 Tavis Smiley at 11pm (prato)
#\0 23 * * 1,2,3,4,5      channel 8, 30min, "Tavis Smiley", 4
# KCET 8 Charlie Rose at 11:30pm (prato)
#\30 23 * * 1,2,3,4,5      channel 8, 60min, "Charlie Rose", 4
# KNBC Channel 4 News at 11pm (prato)
#\0 23 * * 1,2,3,4,5      channel 4, 35min, "Late News", 5
# KNBC 4 Tonight Show Jay Leno at 11:35pm (prato)
#\35 23 * * 1,2,3,4,5      channel 4, 62min, "Tonight Show with Jay Leno", 5
#
## MIDNIGHT
#
# NOTE: Tuesday through Saturday
#
# Watch out for cards already in use at midnight
# -- KABC 7 Nightline is using card 1 until 00:06
# -- KCBS 2 Late Show is using card 2 until 00:37
# -- KCET 8 Charlie Rose is using card 3 until 00:30
# -- KNBC 4 Tonight Show is using card 4 until 00:37
#
# KABC 7 Jimmy Kimmel Live at 12:06am
06 0 * * 2,3,4,5,6      channel 7, 62min, "Jimmy Kimmel Live ", 1
# KCBS 2 Late Late Show with Craig Ferguson
37 0 * * 2,3,4,5,6      channel 2, 60min, "Late Late Show with Craig Ferguson", 3
# KNBC 4 - Late Night with Conan O'Brien (prato)
#\37 0 * * 2,3,4,5,6      channel 4, 59min, "Late Night with Conan OBrian", 4
# MSNBC 61 Hardball With Chris Matthews (also airs 2pm and 4pm) (prato)
#\0 0 * * 2,3,4,5,6       channel 61, 60min, "Chris Matthews", 5
#
## 1AM
#
# KABC 7 Oprah Winfrey at 1:06am (prato)
#\06 1 * * 2,3,4,5,6       channel 7, 60min, "Oprah Winfrey", 4
#
#
#### SATURDAY #####################################################
#
# KABC 7 ABC News at 4pm
0 16 * * 6      channel 7, 60min, "ABC News at 4pm", 1
#
# KCBS 2 CBS News at 5pm
0 17 * * 6      channel 2, 90min, "CBS News at 5pm", 2
# KNBS 4 CBS News at 5pm
0 17 * * 6      channel 4, 60min, "NBS News at 5pm", 3
#
# KNBS 4 CBS News at 6pm
0 18 * * 6      channel 4, 60min, "NBS News at 6pm", 3
# KCET 8 PBS News at 6:30pm (prato)
#\30 18 * * 6     channel 8, 30min, "PBS News at 6.30pm", 4
# CNN 57 at 6pm (prato)
#\0 18 * * 6  channel 57, 60min, "News", 5
#
# CNN 57 at 7pm (prato)
#\0 19 * * 6  channel 57, 60min, "News", 5
#
# KNBS 4 CBS News at 8pm
0 20 * * 6      channel 4, 60min, "NBS News at 8pm", 3
# KTTV Fox 11 News at 8pm (prato)
#\30 20 * * 6      channel 11, 30min, "Fox News at 8pm", 4
#
# KTTV Fox 11 News at 9pm (prato)
#\0 21 * * 6      channel 11, 60min, "Fox News at 9pm", 4
#
# KCBS 2 CBS News at 10pm
0 22 * * 6      channel 2, 60min, "CBS News at 10pm", 1
#
# KNBS 4 CBS News at 11pm
0 23 * * 6      channel 4, 60min, "NBS News at 11pm", 3
#
#
#### SUNDAY #####################################################
#
# KABC 7 ABC This Week With George Stephanopoulos at 8am
0 8 * * 7       channel 7, 60min, "Stephanopoulos", 1
# KNBC 4 Meet the Press
0 8 * * 7       channel 4, 60min, "Meet the Press", 3
#
# FOX 11 Fox News Sunday with Chris Wallace (prato)
#\0 8 * * 7       channel 11, 60min, "News Sunday with Chris Wallace", 5
#
# KNBC 4 News at 3:30pm
30 15 * * 7       channel 4, 30min, "Channel 4 News at 3.30pm", 3
#
# KCBS 2 CBS Face the Nation (prato)
#\0 17 * * 7      channel 2, 30min, "CBS Face the Nation", 4
# KABC 7 World News Sunday (prato)
#\30 17 * * 7     channel 7, 30min, "World News Sunday", 5
#
# KCBS 2 60 Minutes at 7pm
0 19 * * 7      channel 2, 60min, "60 Minutes", 1
#
# KNBC 4 Dateline at 10pm
0 22 * * 7      channel 4, 60min, "Dateline NBC", 3
#
# KABC 7 Eyewitness News
0 23 * * 7      channel 7, 35min, "Eyewitness News", 1
# KNBC 4 News at 11pm
0 23 * * 7      channel 4, 35min, "NBC News at 11pm", 3
# KCBS 2 CBS News at 11pm
0 23 * * 7      channel 2, 30min, "CBS News at 11pm", 3
#
Comment 1 Nicolas Ternisien 2008-03-18 23:53:21 UTC
SVN commit 787315 by ternisien:

Improve errors management
Rewrite and simplify most part of KCron
Add right action buttons list for a easier action access
Improve command line parsing, to avoid the saving of good command line
Reimplement and rewrite the TaskEditorDialog, by allowing a minute per minute selecting, and a smarter
displaying.
Able to add multi-lines comments on variables and tasks
Clean API
All known bugs are now closed, KCron seems to be ready for KDE 4.1

It just needs a icon from KDE Artist team

BUG:59532
BUG:97118
BUG:131433
BUG:135652
BUG:154875


 _M            . (directory)  
 M  +4 -0      src/CMakeLists.txt  
 M  +1 -1      src/crontabPrinter.cpp  
 M  +102 -74   src/crontabWidget.cpp  
 M  +28 -31    src/crontabWidget.h  
 M  +9 -1      src/crontablib/ctGlobalCron.cpp  
 A             src/crontablib/ctHelper.cpp   [License: GPL (v2+)]
 A             src/crontablib/ctHelper.h   [License: GPL (v2+)]
 A             src/crontablib/ctInitializationError.cpp   [License: GPL (v2+)]
 A             src/crontablib/ctInitializationError.h   [License: GPL (v2+)]
 A             src/crontablib/ctSaveStatus.cpp   [License: GPL (v2+)]
 A             src/crontablib/ctSaveStatus.h   [License: GPL (v2+)]
 A             src/crontablib/ctSystemCron.cpp   [License: GPL (v2+)]
 A             src/crontablib/ctSystemCron.h   [License: GPL (v2+)]
 M  +86 -156   src/crontablib/ctcron.cpp  
 M  +84 -35    src/crontablib/ctcron.h  
 M  +42 -31    src/crontablib/cthost.cpp  
 M  +9 -22     src/crontablib/cthost.h  
 M  +5 -1      src/crontablib/ctminute.cpp  
 M  +3 -2      src/crontablib/ctminute.h  
 M  +127 -7    src/crontablib/cttask.cpp  
 M  +16 -1     src/crontablib/cttask.h  
 M  +7 -5      src/crontablib/ctunit.cpp  
 M  +9 -8      src/crontablib/ctunit.h  
 M  +51 -4     src/crontablib/ctvariable.cpp  
 M  +6 -1      src/crontablib/ctvariable.h  
 M  +57 -4     src/genericListWidget.cpp  
 M  +11 -0     src/genericListWidget.h  
 M  +23 -246   src/kcmCron.cpp  
 M  +7 -49     src/kcmCron.h  
 M  +15 -2     src/kcronHelper.cpp  
 M  +3 -0      src/kcronHelper.h  
 M  +0 -24     src/kcronIcons.cpp  
 M  +1 -6      src/kcronIcons.h  
 M  +443 -308  src/taskEditorDialog.cpp  
 M  +47 -24    src/taskEditorDialog.h  
 M  +1 -20     src/taskWidget.cpp  
 M  +0 -2      src/taskWidget.h  
 M  +139 -10   src/tasksWidget.cpp  
 M  +32 -1     src/tasksWidget.h  
 M  +8 -23     src/variableEditorDialog.cpp  
 M  +1 -1      src/variableEditorDialog.h  
 M  +1 -17     src/variableWidget.cpp  
 M  +110 -7    src/variablesWidget.cpp  
 M  +25 -1     src/variablesWidget.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=787315