The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cron job starts new cron proccess ron76 SUN Solaris 3 05-11-2008 10:07 PM
Cron and Pseudo-Cron dingusmcghee UNIX for Dummies Questions & Answers 1 01-31-2008 09:58 AM
CRON usage for CRON job skyineyes UNIX for Dummies Questions & Answers 1 01-17-2008 07:17 AM
AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log Keith Johnson AIX 0 01-09-2008 05:32 PM
Cron : you are not authorized to use cron. Sorry. tt155 UNIX for Advanced & Expert Users 1 07-06-2005 07:37 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-29-2006
Registered User
 

Join Date: Jun 2006
Location: Las Vegas, NV
Posts: 104
Where does cron run from?

I have a script in the same directory as some files and directories im trying to tar up and I have it run in cron. Well it runs but says it can't find the directories, you need to be in the directory where the script is for it to work. Here is my cron and script its crappy but it does the trick =). Is there anyway in cron or my script to get this script to run correctly?

0,5,10,15,20,25,30,35,40,45,50,55 * * * * tmp/daily_backups/daily_backup.pl

$dirtocopy = '/tmp/daily_backups/';
$backupfile = 'backup.tar';

print "Tar'n up directories... \n";
print `tar -cf backup.tar Baro Nitro Turbo`;
print "Done Tar'n directories... \n";

print "Backing up $dirtocopy$backupfile \n";
print `ls | grep backup.tar | cpio -ocB > /dev/rmt/0`;
print "Backup is now complete... \n";

print "Rewinding tape... \n";
print `mt -f /dev/rmt/0 rewind`;
print "Tape rewound...";
Reply With Quote
Forum Sponsor
  #2  
Old 11-29-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 401
You just need to change to the directory before you begin tarring. The line before the tar command should be "cd /tmp/daily_backups" for example.

Carl
Reply With Quote
  #3  
Old 11-29-2006
Registered User
 

Join Date: Jun 2006
Location: Las Vegas, NV
Posts: 104
Thanks! Are there any limits on how big a tar file can be, or file size that will let me tar it.
Reply With Quote
  #4  
Old 11-30-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 989
That depends on several factors... older versions of tar, the filesystem the tar is being saved to, and the operating system itself can all limit the maximum tar size to 2 gigabytes under some situations. If you dodge all these bullets, the theoretical max is extremely large.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
cpio

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0