From owner-freebsd-questions Mon Dec 4 5:53:18 2000 From owner-freebsd-questions@FreeBSD.ORG Mon Dec 4 05:53:16 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mailhost.esil.univ-mrs.fr (jiyu.esil.univ-mrs.fr [139.124.44.249]) by hub.freebsd.org (Postfix) with ESMTP id BF9CC37B400 for ; Mon, 4 Dec 2000 05:53:14 -0800 (PST) Received: from es2irk18 (cam@es2irk18.esil.univ-mrs.fr [139.124.21.118]) by mailhost.esil.univ-mrs.fr (8.9.3/ESIL/jtpda-5.3.1) with SMTP id OAA76965 ; Mon, 4 Dec 2000 14:52:52 +0100 (CET) Message-Id: <200012041352.OAA76965@mailhost.esil.univ-mrs.fr> Date: Mon, 4 Dec 2000 15:57:10 +0100 From: cam To: "Hans Johannsson" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: CRON ?! Executable file ?! In-Reply-To: <200012041318.OAA19167@epsilon.swip.net> References: <200012041318.OAA19167@epsilon.swip.net> X-Mailer: Sylpheed version 0.4.2 (GTK+ 1.2.7; Linux 2.2.17; i686) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 4 Dec 2000 14:18:28 +0100 (MET) "Hans Johannsson" wrote: > Hi. > Im running a freebsd version called IPSO. Its kinda like a stripped freebsd version 4.0 or later i think. > Id like to start CRON jobs. I know how to make the cron -e command, and how to configure the time or date i want it to execute, but i cant get it to execute the commands ive typed into a file. I made a file in VI. I dont know if thats the right thing. And saved it with the regular :w , :q! . > I want to use CRON to take backups of files, every sunday. > The vi file contains the dirs and files i want to backup. > Anyone know how to help me out ?! > > /Hans > #! /usr/bin/bash # directory to save your files SAVE="/tmp/backup" # your vi file VI="/home/me/my.vi.file" mkdir $SAVE if [ $? = 0 ]; then echo The directory $SAVE has been created. fi for i in $(cat $VI); do cp $i $SAVE done ********** END *********** don't forget to "chmod +x thescript" bye cam To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message