General :: Archiving Bash - Script In VIM ?
Dec 14, 2010
I'm relatively new to Linux in general but have learned to do the basics with the CLI.
Well my main problem is writing my first "real" script in VIM. I just have no idea where to start. I was hoping you guys could point me in the right direction.
Well this is what the script needs to do.
"As the IT administrator for a large manufacturing company you have been tasked with producing a script for archiving the daily log files. Each week the daily log files are placed in a directory named weekXX, where XX is the number of the week. Each week directory should be archived and compressed and stored in a folder called log_directories. When the script has completed the task it should display on the monitor exactly what files and directories it has archived.
The script should be started by a user with the required week numbers added as arguments (e.g prog 13 14 15 should start the program and archive the daily log files in week13, week14 and week15).
A basic manual is required, showing how to start the program, the hardware and / or software requirements, a hard copy of the script and a brief description of the test strategy and test data."
View 14 Replies
ADVERTISEMENT
Mar 29, 2011
I need to tar this logs, but i dont how to make it simplier to me. Everyday there are created this five logs. I need to make five tar files from every day from this files at the end of the month
For example
Till now i have tar it manualy (copied every file)
View 2 Replies
View Related
Jun 23, 2010
Which are the Open Source "file and email archiving" software for both Linux and Windows equivalent to Enterprise Vault Symantec?
View 2 Replies
View Related
Feb 24, 2010
I am a little confused in distinguishing Backup, compressing and Archiving data. Help me to figure out how these can be useful.
View 2 Replies
View Related
Aug 4, 2010
I started unarchiving a RAR file that this several gigabytes big. The computer is now going really slow, it's almost frozen. Sometimes I can move the mouse a little, but that's it. The unarchiving process seems to have halted, so now all I can do is restart the system. I don't think I can unarchive this file in Linux.
View 5 Replies
View Related
Oct 6, 2010
I need to back up a fold on a remote machine to my local box; the remote hd does not have enough space archive it, neither does my local box. I know there's a cantrip to pipe scp through gzip (or similar), but I don't remember the syntax.
View 1 Replies
View Related
Jun 4, 2011
I have a script which periodically backs up a directory using the command "tar -czvf [name] [directory]" but my problem is that the script has recently been putting a lot of stress on the server (Minecraft SMP) and tends to lag players as it backs up, which recently has been taking nearly 5 minutes.So I need to know if there's a way to control the GZip compression rate at the same time that it archives and backs up the files?I understand that I can first tar the files and then GZip them separately with a different compression rate afterwards, but this would not work because it names the files with the current server time, which sometimes changes in between commands.
View 1 Replies
View Related
May 17, 2011
i am using red hat linux 2.4 . I have 3 folders dir1 dir2 dir3 I have tarred them like this.
1.tar cvfz tarball_1.tgz dir1 dir2 dir3
2.tar cvfz tarball_2.tgz dir1 dir2 dir3 2>& /dev/null (So that it does not display any error message or operation details to the user)
[usr@machine]$ ls -lrt
-rw-r--r-- 1 usr grp 199843988 May 17 13:39 tarball_1.tgz
-rw-r--r-- 1 usr grp 199837488 May 17 13:53 tarball_2.tgz
But can any one explain the size difference as seen in list output...
View 4 Replies
View Related
Feb 28, 2011
I need a script that accepts two parameters inputDir and outputDir.
This script should copy all the log files in the inputDir to a folder like <BackupLogs-currentDaysDate>
The new folder with the log files should be tarred and gzipped <BackupLogs-currentDaysDate>.tgz
And this new <BackupLogs-currentDaysDate>.tgz file should be copied to the outputDir.
Also all the log files in the inputDir should be deleted.
View 16 Replies
View Related
Jun 22, 2011
I sometimes get confused by the varying command line options I need to run common Unix archiving and compression software (e.g. gzip, bzip2, zip, tar).
Is there a program out there that can just Do What I Mean for common cases? For example:
View 2 Replies
View Related
Jul 22, 2010
I'm looking for an application that will give me some advanced tools for editing PDFs.
Here are the features I'm looking for:
Editing metadata (tagging with keywords)
Merge multiple PDFs
Rearrange page order
PDF bookmarking
Optical Character Recognition
I can give further clarification on these items if needed. My goal is to convert all of my paper files into digital files that I can store on my server. In order to effectively do this, I need the tools listed above.
Is there anything in the linux world that will give me these PDF editing abilities?
View 4 Replies
View Related
Jan 31, 2011
I want to create retrievable archives of a my old emails say monthly to avoid the old emails running me out of memory. If I use the 'Backup Settings' procedure as explained in Evolution Help what happens when I wish to consult the /home/dbus/evolution-backup.tar.gz archive file?
1- Will it simply over-write my current Evolution data? [in which case its not what I need]
2- If not, how do I return the archive file to dead storeage and resuscitate my current data?
3- If it will overwrite using the 'Restore Evolution' procedure given in Evolution Help is there a workaround ... perhaps by ...
3a- renaming the archive file,
3b- or 'restoring' it in another version of Evolution,
3c- or archiving CURRENT data as a 2nd backup with a different name [eg: /home/dbus/evolution-backupJan11.tar.gz?] then restoring that?
4- Will I be able to retrieve successive archives if I rename them, say '/home/dbus/evolution-backup.tarDec10.gz' etc once Evolution's saved them?
Alternatively the following came from a dead thread [from commonlyUNIQU3 ] ... is it still valid? does it avoid the problem of potentially running out of memory?
A. Make a subfolder to the "Inbox" under the "On This Computer" tree (I call mine "Archive")
B. Drag and drop the emails you want to archive into this folder.*
This will move the selected emails off of your Exchange server/account and into this folder (and into local storage) - unless you do a copy & paste instead of drag & drop. You may need to have the setting for downloading emails for offline access enabled for this to work as desired. If I recall, the new integrated backup feature creates a compressed (.zip) archive from which you can later restore the email (haven't tried that just yet).
View 5 Replies
View Related
Mar 4, 2011
I'm trying to zip or rar >100000 files into a single file so that I can upload it to my server much faster than ftp downloaded it. Total they're all only 4gb, but because of the number of files Nautilus freezes just opening the folder they're in. They're all .jpgs and all in the same folder and I've tried a few commands but I keep getting error messages.
Anyone have a command that will archive all the files from a folder into a single zip (or rar, tar etc)? I can't just archive the folder because then I would have to move all the files out of that folder and just opening the folder to move them would crash it, and I don't have ssh into that server.
View 3 Replies
View Related
Mar 20, 2011
I have a problem with a script i wrote, the script runs fine if manually executed however it doesn't run *fully* when executed via cron
here's the script :
Code:
#!/bin/bash
FILENAME=mysql_full_dump_`date '+%m.%d.%y'`.sql
`which mysqldump` --all-databases -uroot -p************ -h127.0.0.1 > /root/$FILENAME
RETVAL=$?
[code]....
the script resides in /root/bin and the cron entry is as follows:
Code:
0 0 * * * root "/root/bin/mysql_daily.sh"
the result is the .sql file, but it doesn't archive it.
View 2 Replies
View Related
Nov 29, 2010
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
View 6 Replies
View Related
Jul 17, 2010
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
View 13 Replies
View Related
Dec 3, 2010
What happens when the script executes is that the ssh connection works and parks me at the remote hosts's shell login. Therefore, the "firefox" command refuses to execute. I need to know how to make the "ssh" connection occur, stay open, and go into the background so that the rest of the script can execute.If I could also do this with the "firefox" line so that the entire term window could be closed would also be helpful.
View 3 Replies
View Related
Oct 26, 2010
At my work place, my colleagues or I create/start bunch of small projects.
Each of these small projects contain some document (pdf, word and etc.) and/or different types of documents.
I am looking for a simple software (preferred GPL) which can be run on Linux and/or Windows and can manage to maintain those small projects.
It can be a web based software, which would assign an unique number to the each new created project and then would create the necessary links, which would point to the necessary documents, as I mentioned above.
View 2 Replies
View Related
Jul 29, 2010
I'm looking for ... or will develop if I cannot find any ... software that can keep archives of a tree of files. The tree of files is on a computer dedicated to backups. Various servers and desktop users periodically run rsync to update their slice of that tree of files. But that means old files are replaced. What I want to do is keep the old files around, with some limitations (such as a finite number of versions, finite age, etc). This would be similar to a repository like Subversion, except that data only comes in (there are no checkouts, though obviously a restore mechanism is needed). It would be like rolling backups, except the "rollover" would be on a per-file basis.
What I currently do, but want to get away from, is making a hardlink replica tree every few days with a command like "cp -al synctree/. archtree-for-today". But that eats up inodes very rapidly and is much harder to find things in. Making a file listing is very much slower this way, too.
View 3 Replies
View Related
Dec 8, 2009
On one of my servers I see this when I log in. What does this mean and how can I get it to go away? Everything seems to work fine, but none of my other machines give this error.
View 5 Replies
View Related
Feb 4, 2011
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
View 3 Replies
View Related
Jan 24, 2010
simple bash code:
Code:
#!/bin/bash
trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c
echo "Press ctrl+c during 5 sec loop"
for ((i=0;i<5;i++)); do
[Code]...
How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!
View 10 Replies
View Related
Jun 5, 2011
I got a problem with terminal, since i'm really a noob with terminal i don't know how to fix it.Everytime i type in a command it shows for example:
-bash: ls: command not found
Even the basic commands don't work... just cd <directory> and those things works
View 9 Replies
View Related
Nov 26, 2008
I have a config file that contains:
my.config:
Code:
Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.
Here is my parse_cmd script:
Code:
View 3 Replies
View Related
Jul 25, 2011
I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.
Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?
View 5 Replies
View Related
Jan 13, 2011
I have searched and searched and maybe I don't know how to articulate this issue with out just posting the problem I'm having. Every time I bring up a terminal window I get the following "Header"
declare -x COLORTERM="gnome-terminal"
declare -x CPLUS_INCLUDE_PATH="/usr/lib64/qt/include"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-xSFd6zqrYQ,guid=dc5e07974559da016842742900000090"
declare -x DISPLAY=":0.0"
[Code]...
To be honest I cheated and used the .bashrc / .profile files from Ubuntu and all was working fine for a while now and it seems something changed to cause this... any ideas on why I am getting this? I checked my .bashrc and my /etc/profile and it doesn't look like anything is amiss..
View 3 Replies
View Related
Jan 9, 2010
I would like to get the filename (without extension) and the extension separately. The best solution I found so far is:
Let FILE="thefilenameofsomefilesfor_instance.txt"
Code:
NAME=`echo "$FILE" | cut -d'.' -f1`
EXTENSION=`echo "$FILE" | cut -d'.' -f2`
I think it would be better to count the len and remove 3 chars to right to get the extension, but it can be macintosh filenames with have 4 chars for extensions.
View 5 Replies
View Related
Mar 18, 2010
Im used to using nautilus within centos but have recently just got a VPS and quickly realising that using a KDE is unacceptable in this environment. Although I do find it so much quicker doing things like folder permissions in KDE rather than typing it all out in the terminal? Everyone I speak to says, use the terminal and I should learn this way as opposed to using the KDE, but theres certain things I just dont get
How is it possible to make quick changes to scripts and viewing them in a browser etc , without a mouse or using KDE? and only using a terminal?? I am wondering how to develop websites just using the terminal?
How can it be quicker to type out/view permissions etc in the terminal when its instant and just a few clicks in the KDE?
View 3 Replies
View Related
Sep 14, 2011
What is the difference between &> and >& in bash? tldp did not mention the latter one. Is it really a redirection operator?
View 3 Replies
View Related
Dec 2, 2010
I am looking for a bash script to do the following.
File1:
ID Size
1 8
2 8
[code]....
the script should read the above file and take my input as Size = 8 (may be), count = 3 , sequential = Y and the output should be
7
8
9
and if sequential = N it should give me first 3 ID's with size 8.
1
2
7
note that the ID's are in Hex
View 8 Replies
View Related