LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2004, 09:38 AM   #1
dennis_89
LQ Newbie
 
Registered: Jun 2004
Posts: 27

Rep: Reputation: 15
timed backups


I have a quick question, hopefully. I have written a script to allow for backups of my SHARES and I am wondering if there is a way to have them run at particular times during the evening say at 9:00pm every night, full backup at 10:00pm once a week. I know that I have to put them in the cron file for daily, weekly, monthly, but I am wondering if there is a way to have it run at a particular time during the day. The script I am using is as follows:

Code:
#!/bin/sh
#This batch file backs up the data from SHARE
# -------------SCRIPT VARIABLES for laptop--------------
#This section can be changed for the other SHARES to be backed up

SHARE="//laptop/SharedDocs";
DATADIR="DATA";
USERNAME="administrator"
PASSWD="administrator_password";
BACKUPFILE="laptop_backup_test.zip";
BACKUPDRIVE="/dev/hdc1";
BACKUPMP=/mnt/backups/";
SMBMP="/mnt/smb/";

#-------------------------------------------------------
export PASSWD;
echo 'go';
smbmount $SMBMP;
smbmount $SHARE $SMBMP -N -n$USERNAME;
if (ls $SMBMP$DATADIR) tehn
     echo "Backing up $SHARE";
     mount -t vfat $BACKUPDRIVE $BACKUPMP;
     cd $SMBMP;
     zip -r -u -v $BACKUPMP$BACKUPFILE $DATADIR;
     cd /;
     umount $BACKUPDRIVE;
fi;
     smbmount $SMBMP;
Thanks in advance,

Dennis
 
Old 06-17-2004, 09:42 AM   #2
jonavogt
LQ Newbie
 
Registered: Apr 2004
Location: Germany
Distribution: SUSE 9.2 Pro | Gentoo | Fli4l
Posts: 16

Rep: Reputation: 0
Hi Dennis,

see man 5 crontab

Code:
 # run five minutes after midnight, every day
       5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
       # run at 2:15pm on the first of every month -- output mailed to paul
       15 14 1 * *     $HOME/bin/monthly
       # run at 10 pm on weekdays, annoy Joe
       0 22 * * 1-5   mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
       23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
       5 4 * * sun     echo "run at 5 after 4 every sunday"
cheers
Jonathan
 
Old 06-17-2004, 09:55 AM   #3
dennis_89
LQ Newbie
 
Registered: Jun 2004
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks a lot,

Dennis
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPC: Timed Out adelaideyip Linux - Networking 0 08-24-2004 04:07 PM
Connection timed out tuttu Linux - Networking 2 08-06-2004 07:05 PM
Timed Script rridler Programming 10 07-01-2004 10:52 PM
still trying to get timed backups dennis_89 Linux - Networking 3 06-17-2004 05:26 PM
Connection timed out Valluvan Programming 6 12-22-2002 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration