Sponsored Content
Top Forums Shell Programming and Scripting Problem running zip from cron - bad zipfile offset Post 302937043 by Don Cragun on Monday 2nd of March 2015 09:17:46 PM
Old 03-02-2015
Just as $PATH is not inherited from your environment to be used when a cron job you submit runs, the variables in your script $dirlog, $date, $dirzip, and $dircom are undefined when cron runs this script.

Are the results what you would expect to see if you ran the script:
Code:
# Rsync website.com to local machine
/usr/bin/rsync -Pavzhe "ssh -p 22" --log-file=\_website.rsync.log --bwlimit=2500 --skip-compress=jpg/zip --delete user@website.com:'/home/user/' "/mnt/data/Backups/website.com"
# Zip site to 2G chunks
/usr/bin/zip -r -s 2g -y -2 /website_.zip /

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find files within a zipfile on AIX5.3

In a directory I have several zipfiles, every zip files has some csv files within. I need to find out which zipfiles have the particular csv files. I know we can use a zipgrep on linux. Does AIX have a similar command. Any help appreciated. Thanks & Regards, Ram (1 Reply)
Discussion started by: ramky79
1 Replies

2. Shell Programming and Scripting

Behavior of Bad Script in Cron Job

Hi A Ksh script is deployed in a server and executed through cronjob. If one of the line in the middle of the script fails . Are the remaining lines executed ? (3 Replies)
Discussion started by: Sivaswami
3 Replies

3. UNIX for Dummies Questions & Answers

Problem running a cron job

I have created a cron job for the vtiger workflow to execute the shell file named com_vtiger_workflow.sh to run the workflow. I've created the following line in crotab -e : 00 13 * * * /var/www/html/prashant/cron/modules/com_vtiger_workflow/com_vtiger_tiger_workflow.sh | mail -s 'Check... (2 Replies)
Discussion started by: anaigini45
2 Replies

4. Shell Programming and Scripting

Cron job running problem

Hi Guys, I am trying to run a script through contab. The script can only be executed once user logs in as su - oracle. I have tested the script other then cronjob and it executes successfully, more over the paths used in the script are absolute paths. Crontab entries are as as below.... (3 Replies)
Discussion started by: Asteroid
3 Replies

5. AIX

Partition offset problem after re-mirror vg

We had a mirrored disk failed (not the rootvg), there are 3 lvs (transfer, applogs, arch) from extvg gone open/stale state. After replaced failed disk and run cfgmgr, the new replaced disk is visible: ) I did the following to re-mirror new disk: # extendvg prodvg hdisk3 # lspv (got new pvid on... (2 Replies)
Discussion started by: jalite19
2 Replies

6. Shell Programming and Scripting

bad interpreter when running script

Hi All, I'm not confortable in writing script, can someone can help me, when I run that script below i found this error code : -bash: ./script.sh: /bin/sh.: bad interpreter: Here is the script for i in * x=${i##*.} z=$(perl -e 'print time;') t=$(echo $z-$x|bc)... (12 Replies)
Discussion started by: bzb23
12 Replies

7. Solaris

! bad user (adm).. in cron log

I have noticed this error in /var/cron/log: > CMD: /usr/lib/acct/ckpacct > adm 6739 c Tue Oct 11 10:00:00 2011 < adm 6739 c Tue Oct 11 10:00:00 2011 rc=1 ! bad user (adm) Tue Oct 11 11:00:00 2011but when I try to list crontab of user 'adm': solarni/~# crontab -l adm crontab: you are... (4 Replies)
Discussion started by: orange47
4 Replies

8. UNIX for Advanced & Expert Users

Running multiple php scripts into one php only, cron mail alert problem...

hi, while separated they produce the usual mail alert and i can see the output... if i write into the php script: <?php system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script1.php'); system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script2.php'); system('php -f... (0 Replies)
Discussion started by: 7stars
0 Replies

9. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

10. UNIX for Advanced & Expert Users

Grep --byte-offset not returning the offset (Grep version 2.5.1)

Hi, I am trying to get the position of a repeated string in a line using grep -b -o "pattern" In my server I am using GNU grep version 2.14 and the code is working fine. However when I am deploying the same code in a different server which is using GNU grep version 2.5.1 the code is not... (3 Replies)
Discussion started by: Subhamoy
3 Replies
zipios::ZipFile(3)					     Library Functions Manual						zipios::ZipFile(3)

NAME
zipios::ZipFile - SYNOPSIS
#include <zipfile.h> Inherits zipios::FileCollection. Public Member Functions ZipFile () Default constructor. ZipFile (const string &name, int s_off=0, int e_off=0) Constructor. virtual FileCollection * clone () const Create a heap allocated clone of the object this method is called for. virtual ~ZipFile () Destructor. virtual void close () Closes the FileCollection. virtual istream * getInputStream (const ConstEntryPointer &entry) virtual istream * getInputStream (const string &entry_name, MatchPath matchpath=MATCH) Returns a pointer to an opened istream for the specified entry name. Static Public Member Functions static ZipFile openEmbeddedZipFile (const string &name) Detailed Description ZipFile is a FileCollection, where the files are stored in a .zip file. Definition at line 20 of file zipfile.h. Constructor &; Destructor Documentation zipios::ZipFile::ZipFile () [inline] Default constructor. Definition at line 37 of file zipfile.h. zipios::ZipFile::ZipFile (const string &name, ints_off = 0, inte_off = 0) [explicit] Constructor. Opens the zip file name. If the zip 'file' is embedded in a file that contains other data, e.g. a binary program, the offset of the zip file start and end must be specified. Parameters: name The filename of the zip file to open. s_off Offset relative to the start of the file, that indicates the beginning of the zip file. e_off Offset relative to the end of the file, that indicates the end of the zip file. The offset is a positive number, even though the offset is towards the beginning of the file. Exceptions: FColException Thrown if the specified file name is not a valid zip archive. IOException Thrown if an I/O problem is encountered, while the directory of the specified zip archive is being read. Definition at line 30 of file zipfile.cpp. zipios::ZipFile::~ZipFile () [virtual] Destructor. Definition at line 46 of file zipfile.cpp. Member Function Documentation FileCollection * zipios::ZipFile::clone () const [virtual] Create a heap allocated clone of the object this method is called for. The caller is responsible for deallocating the clone when he is done with it. Returns: A heap allocated copy of the object this method is called for. Implements zipios::FileCollection. Definition at line 41 of file zipfile.cpp. void zipios::ZipFile::close () [virtual] Closes the FileCollection. Implements zipios::FileCollection. Definition at line 50 of file zipfile.cpp. istream * zipios::ZipFile::getInputStream (const ConstEntryPointer &entry) [virtual] Returns a pointer to an opened istream for the specified FileEntry. It is the callers responsibility to delete the stream when he is done with it. Returns 0, if there is no such FileEntry in the FileCollection. Parameters: entry A ConstEntryPointer to the FileEntry to get an istream to. Returns: an open istream for the specified entry. The istream is allocated on heap and it is the users responsibility to delete it when he is done with it. Exceptions: InvalidStateException Thrown if the collection is invalid. Implements zipios::FileCollection. Definition at line 55 of file zipfile.cpp. istream * zipios::ZipFile::getInputStream (const string &entry_name, MatchPathmatchpath = MATCH) [virtual] Returns a pointer to an opened istream for the specified entry name. It is the callers responsibility to delete the stream when he is done with it. Returns 0, if there is no entry with the specified name in the FileCollection. Parameters: matchpath Speficy MATCH, if the path should match as well, specify IGNORE, if the path should be ignored. Returns: an open istream for the specified entry. The istream is allocated on heap and it is the users responsibility to delete it when he is done with it. Exceptions: InvalidStateException Thrown if the collection is invalid. Implements zipios::FileCollection. Definition at line 61 of file zipfile.cpp. ZipFile zipios::ZipFile::openEmbeddedZipFile (const string &name) [static] Opens a Zip archive embedded in another file, by writing the zip archive to the end of the file followed by the start offset of the zip file. The offset must be written in zip-file byte-order (little endian). The program appendzip, which is part of the Zipios++ distribution can be used to append a Zip archive to a file, e.g. a binary program. Exceptions: FColException Thrown if the specified file name is not a valid zip archive. IOException Thrown if an I/O problem is encountered, while the directory of the specified zip archive is being read. Definition at line 19 of file zipfile.cpp. Author Generated automatically by Doxygen for Zipios++ from the source code. Zipios++ Mon Oct 10 2011 zipios::ZipFile(3)
All times are GMT -4. The time now is 09:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy