Ubuntu :: Shell Script Using File Name
Jan 6, 2011
I'm trying to create a script that will back up my databases daily, then keep a weekly version, then keep a monthly version. I know there's a script out there that will make a mysqldump on the first of the month and call that the monthly version, but that doesn't seem right to me. So I was thinking maybe I could put the date +%s in the file name (along with other things like the name of the db, etc) and then do some kind of if statement based off of that date in the file name in order to take the monthly (and weekly) versions.
View 8 Replies
ADVERTISEMENT
Oct 31, 2010
Code:
cat ${SOURCE}/{start,universal,index,end}.txt > ${SERVER}/index.html
cat ${SOURCE}/{start,universal,02042010,end}.txt > ${SERVER}/02042010.html
[code]....
View 3 Replies
View Related
Dec 9, 2008
How can I read .gz file direct on shell/terminal without decompressing the file?
satimis
View 5 Replies
View Related
Mar 30, 2010
I need a shell script that will add the users name and date to a file when the user has modified the file, these files are within a group and only accessible to this group. But we need a way for people in the group to know who and when the file was last modified.
View 1 Replies
View Related
May 23, 2011
i am trying to convert a binary file in to ASCII using shell script. this file contains multiple types of data like string, number, bcd, etc.
View 5 Replies
View Related
Jul 9, 2009
parsing xml file using shell script and generate report in a PDF file
Xml file input:
<report>
<student name="x" father name="x1" class="first" Address="xyz">
<property name="sports" value="yes"/>
<property name="drawing" value="no"/>
[code]....
View 12 Replies
View Related
May 11, 2011
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
something like: -printfunction -printername < file*
View 7 Replies
View Related
Jan 24, 2010
Quote:
/usr/local/bin/mencoder /root/video1.avi -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:acodec=libfaac:abitrate=64 -srate 22050 -oac lavc -vf scale=360:240 -o /root/output_temp_video1.flv
[code]....
View 2 Replies
View Related
Jan 11, 2011
Ubuntu version 10.10File location inside a folder on DesktopFile extn : .shI need to run this file in terminal console, but what path to be given is the question.
View 5 Replies
View Related
Feb 15, 2010
I have to install a program from a tar.gz file. I have extracted it using fileroller, and it contains an installation "shell script" file.
I have no idea what scripts are, or how they work. I tried sudo make/sudo make install, with no luck. how I install this program using the shell script file?
View 3 Replies
View Related
Mar 3, 2011
today itself i joined a shell account given to me by cjb.net. i am able to ssh [URL] from my putty... but how can i download files or get help from the this server...
View 9 Replies
View Related
Mar 28, 2011
How can I download a file via HTTP from a shell?
View 3 Replies
View Related
Jun 2, 2010
I downloaded the demo of Penumbra Overture, it is a sh file (113Mb). I can't open the file.In a terminal I ran chmod +x PenumbraOvertureDemo-2553sh and then sudo./PenumbraOvertureDemo-2553sh and I get an error "./PenumbraOvertureDemo-2553sh: 2:Syntax error: "(" unexpected" . The quotation marks are my own. Is the file corrupted?ne of my lugmates thinks it might be a shar file, but Karmic says that it is a shell script.Another friend says that it is too large to be a shell script. Here is the code:
johnjohn-laptop:~$ cd /home/john/00
johnjohn-laptop:~/00$ chmod +x PenumbraOvertureDemo-2553sh
johnjohn-laptop:~/00$ sudo ./PenumbraOvertureDemo-2553sh
[code]....
View 5 Replies
View Related
Jul 30, 2010
When I try to execute my script its getting error
.........................................
tape_restore.sh: 40: source: not found
tape_restore.sh: 41: source: not found
tape_restore.sh: 42: source: not found
.................................
But in Redhat I can run same script . My script as follows.
**************************************************
SCRIPT_HOME=/home/dhanushka/project/mChoise_Recharge/scripts/scriptfw
TAPE_DRV=/dev/st0
[code]....
View 4 Replies
View Related
Aug 17, 2010
Does anyone know how to make the file colours appear different for each file type in the shell like happens in ubuntu?
View 4 Replies
View Related
Jul 23, 2010
I have a number of text files throughout my /home/pjs/Documents directory tree that have execute permissions set. Almost all of my file names have spaces in them. I am trying to write a shell script that will look at each file in my Documents directory, find the ones that have execute permissions set, and run the command chmod 644. Of course, I don't want the command run on the directories.
The following script *doesn't work*, but might serve to illustrate what I am trying to do:
#!/bin/bash
for x in "$(ls -R)" do
if [ -f "$x" ] && [ -x $x ]; then
chmod 644 "$x"
fi
done
I want each file and directory name to be placed, one by one, in the variable $x, and then tested with the "if" conditionals.
The first problem seems to be that, although the command "ls -R" does produce a complete list of the files and directories I need, they are not placed, one by one, in the variable x like I want them to be.
Also, I think I should use the shift command so that the option -R doesn't get included as one of the values of the variable $x, but I can't figure out where to put it.
View 14 Replies
View Related
Jan 3, 2011
So if I have a file with a list of files:
file.txt
file1.a
file2.b
file3.c
and I wanted to perform a script using a loop or recursively on each of those files, is there any way that I could do this?
I saw that xargs might be able to help me.
Here is sorta what I want to do:
Code:
#!/bin/bash
cat file.txt | xargs?? # Some commands to turn each line into a variable
for var in ${@}; do # Some way to get each of the files
# script on each file
View 1 Replies
View Related
Jul 30, 2010
I'm using Ubuntu minimal install (With no window manager). What is the quickest and easiest way to upload a file somewhere? Something like a script to pastebin would work.
View 2 Replies
View Related
May 9, 2011
I have a small script that uses the find command to look for a log file named: backup_log.txt. And then uses the first value in the log file as a variable in the script later on. However, say there are two or more of these log files located in different directories, how would I let the user choose which log file will be the one to use, and then make that (fullpathtofile) the value of the variable that will be used.
View 5 Replies
View Related
May 2, 2011
I am working on some homework, however i am not here to be spoon fed. I am trying to get the numerical modification date of each file in a folder. Ie lets say there is a file called bob and it was modified 2006-11-23. i want to get it into a variable as 20061123.
Now i currently have this code:
Code:
However for some reason my output is:
Quote:
See how the 2011 has been placed next to it? i ran it with -x and saw this:
Code:
However i do not know how to find a way around this?
View 11 Replies
View Related
Jun 21, 2010
I need to convert the following .bat file to a linux shell script.experienced and kind linux folks:
:: Import database schema
echo off
echo.
[code]....
View 2 Replies
View Related
Jan 26, 2011
I'm using fedora 14...i would like to insert few texts to a file in shell prompt(may be useful in scripting for in the future)...for eg,
[root@ruby ~]# cat > hello
1
2
2
[code]....
so in the above file i need to add the line "new line added" near the number 4 in the above file ....how can be this done ...?
View 8 Replies
View Related
Dec 12, 2010
I want to overite a file using shell script.
i need to overite the file withe value of 2nd argument.
echo $2 > /home/dir/file.txt whether this will work? or what is the correct syntax?
View 2 Replies
View Related
Jun 30, 2011
i need to config the file using the shell scripts..
i have set the static ip using shell scripts
1st it should ask the ip values 2nd it should check the file is exist or not 3rd then add the values or re edit previous values
i need to set only IP static
View 2 Replies
View Related
May 7, 2011
I tried to create logfile for the below shell program but i was not able to get log file,can anyone help me for the below program to create a log file for the shellscript.
View 12 Replies
View Related
Mar 12, 2010
So my firefox's profile.ini file looks like this:less .mozilla/firefox/profiles.ini
Code:
[General]
StartWithLastProfile=1
[code]...
View 9 Replies
View Related
Apr 7, 2010
I am trying to execute a 4GE file using command something like this "/usr/bin/ksh path of the file with some arguments " ex: /usr/bin/ksh /home/abc.4ge S "./xyz" . I am able to execute the 4GE without this "/usr/bin/ksh" specifying in the command which basically runs in ksh shell itself. But when i try to run it exclusively using the path of the shell it gives me an error something like this "/usr/bin/ksh: /home/abc.4ge: cannot execute". I did check the permissions and all the file has execute permission.
View 7 Replies
View Related
Jun 26, 2010
I have 2 external hdd in wich I have all my files.... yesterday, I have copied all the files from hdd1 to hdd2 and I want to eliminate duplicates so I used FSLint to find them, now, I have a txt file that looks like this code...
now I want to make a shell script to delete all the files/entries (read from the log file) that begin with code...
View 2 Replies
View Related
Feb 23, 2011
Im using an if statement in the bin ash shell and it isnt working.
Code: if (( 5000 > $available_blocks )) then echo "WARNING Disk space low, "$pct_used" is used" fi
I don't think its a problem with the if. When i use that code it creates a file with name of the value $available_blocks instead of using the '>' sign for comparing the 2 numbers.
View 6 Replies
View Related
Oct 4, 2009
if I wanted to run a shell script from a remote file (say on my desktop) in which when clicked the file the shell script would run how would I do so?In other terms, the file would contain the command: sh /home/Phobos/Documents/jes-4-2-2-nojava/JES.sh
However what extension should the file have in order to run on click?
View 5 Replies
View Related