Ubuntu server guide archive rotation script

Bug #1010805 reported by Paul Worrall
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Server Guide
Fix Released
Undecided
Doug Smythies

Bug Description

The script provided under "Rotating NFS Archives" fails on the 8th and 9th days of each month with the error:

((: 08: value too great for base (error token is "08")

I'm no expert so please check this, but I think the reason is because $(date +%d) returns "08" or "09" and when the following arithmetic comparisons are executed bash tries to convert the string to a number but the leading zero signifies octal and 08 and 09 are not valid octal numbers.

The solution is to use $(date +%-d) the "-" tells date not to pad with zeroes.

Related branches

Revision history for this message
michael freiermuth (0-mf) wrote :

I can confirm that it works with $(date +%-d)

Using it with debian squeeze

John Kim (kotux)
tags: added: script serverguide
Changed in ubuntu-docs (Ubuntu):
status: New → Invalid
no longer affects: ubuntu-docs (Ubuntu)
Changed in serverguide:
status: New → Confirmed
Revision history for this message
Graham C (chckens) wrote :

I ran in to this issue after borrowing the script at:
https://help.ubuntu.com/lts/serverguide/backups-shellscripts-rotation.html

My fix was exactly the same as others have mentioned.

(Does it normally take 5 years to change a single character in the docs? ;-))

Revision history for this message
Doug Smythies (dsmythies) wrote :

Graham wrote:

> Does it normally take 5 years to change a single character in the docs?

Since nobody helps with the serverguide, yes.

Changed in serverguide:
status: Confirmed → In Progress
assignee: nobody → Doug Smythies (dsmythies)
status: In Progress → Fix Committed
Changed in serverguide:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.