ROCKLAND, Maine — A 59-year-old Camden man has pleaded guilty to forging a prescription to illegally obtain a drug for recreational use.

Sentencing for Scott Harvie will not be held for another 12 months as part of a deferred disposition approved Wednesday in Knox County Superior Court by Justice Jeffrey Hjelm. In one year, according to the agreement, Harvie could be sentenced to up to 45 days in jail if he adheres to terms of the deferred disposition, although the defense can argue for less time. The terms include that Harvie commit no further crimes, that he abstain from using illegal drugs, and that he undergo a substance abuse evaluation and treatment if required.

The sentence was agreed to, in part, because a video recording of an interview by Camden police of Harvie was inadvertently taped over at the police station. Assistant District Attorney Christopher Fernald said the department informed him that its recording system recycles and if the video is not retrieved soon enough, it is erased by new material.

Camden Police Chief Randy Gagne said Wednesday that it had an aging recording system and that if the officer does not request a particular recording it can be recorded over within four to five days. He said the town is going out for bids for a new recording system.

The investigation into Harvie began when a man attempted to fill a prescription for the painkiller vicoprofen at the Rite Aid Pharmacy in Camden in October 2011, according to an affidavit filed in Rockland District Court.

The pharmacy had been alerted by a doctor to be on the lookout for prescriptions from her office if it looked like a stamp had been used for the physician signature. The pharmacist declined to fill the prescription and the man left. A pharmacy technician went out to the parking lot and got a description of the vehicle and the license plate number of the vehicle used by the customer.

The pharmacy also checked the telephone number left by the man and found that the same number was used by multiple customers for different prescriptions.

Camden police interviewed Harvie a few days later in which he admitted to having forged prescriptions on earlier occasions as well, Fernald said.

Justice Hjelm said the agreed upon disposition was reasonable considering the loss of the video and because Harvie has no criminal history. However, the judge pointed out that an aggravating factor was the man’s admitting he used the drugs for recreational purposes and did not have a medical reason for the medication.

Harvie pleaded guilty to forgery and acquiring drugs by deception but the latter charge — a felony — will be lowered to a misdemeanor attempted acquisition if he adheres to the terms of the agreement. If Harvie fails to adhere to the terms, there will be no sentence agreement and he will be sentenced for a felony.