Sponsored Content
Homework and Emergencies Homework & Coursework Questions Create a simple bash backup script of a file Post 302718675 by Yoda on Saturday 20th of October 2012 12:39:31 PM
Old 10-20-2012
1. Create a script file: make_copy.sh:-

Code:
cat > make_copy.sh
file_name="/home/field1"
cp ${file_name} ${file_name}.bak

2. Run the script file: make_copy.sh:-

Code:
chmod +x make_copy.sh
./make_copy.sh

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff. Backup Script Using TAR. Should be simple.

I'm specifically trying to find help or insight on using the --incremental ('-G') option for creating a tar. Please resist the urge to tell me to use --listed-incremental ('-g') option. That's fairly well documented in the GNU tar manual. GNU tar 1.19 This is what the manual does say in section... (0 Replies)
Discussion started by: protienplant
0 Replies

2. Shell Programming and Scripting

[bash] Simple backup (cp) script but incremental

Hi all, I would need a rather simple bash backup script that loops throught the (local) users and for each users backs up (cp!) its /home/username folder. About the functionalities: The script has to run every 2 hours (that's cron, so don't mind about that) and the files should be copied to... (12 Replies)
Discussion started by: laurens
12 Replies

3. Shell Programming and Scripting

Simple Script to create folders

Hi I want to write a small script that will create folders named from `AAAA' all the way to `ZZZZ'. That is: `AAAA' `AAAB' `AAAC' ... `AABA' `AABB' `AABC' ... `ABAA' `ABAB' `ABAC' ... `ABBA' ... `ZZZZ' (4 Replies)
Discussion started by: ksk
4 Replies

4. AIX

backup script failed with error '0403-005 Cannot create the specified file'

In AIX 5.1, a daily run script that backing up oracle data failed yesterday with following errors: The Tivoli backup of DBPROD failed. What could be the issue, OS, backup or Oracle? (3 Replies)
Discussion started by: jalite19
3 Replies

5. Shell Programming and Scripting

How to create a simple shell script to backup

Hello - I am in process of deleting many files which are older than 4 weeks. For example I am inside: /subsystem/prod/ Files are with various extentions, but anything older than 4 weeks should be deleted. What would be the most simplest script to acheive this? (4 Replies)
Discussion started by: DallasT
4 Replies

6. Shell Programming and Scripting

How to create a simple copy script?

Guys I want to do this: copy: /var/router/system1/config/backup/install.put /var/router/system2/config/backup/install.put /var/router/system3/config/backup/install.put /var/router/system4/config/backup/install.put into: /var/router/system1/config/install.dat... (22 Replies)
Discussion started by: DallasT
22 Replies

7. Homework & Coursework Questions

A simple Backup script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: All I have to do is write a script that will take two arguments. The first argument is a list which will contain... (1 Reply)
Discussion started by: Waffles
1 Replies

8. Shell Programming and Scripting

Create simple script

Dear all, I have a directory named A and some subdirectories named B, C, D with .xml files. I want to use the following command to strip the file. sed -re ':start s/<*>//g; /</ {N; b start}' file.xml > file.xml At the same time, I want to remove the blank lines using sed '/^$/d' How can... (6 Replies)
Discussion started by: corfuitl
6 Replies

9. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

10. Shell Programming and Scripting

Create excel file using bash script

i have written one script which generates text file which gives output like. 001.config: CR1.1 COMPILE_PASSED TEST_PASSED 002.config: CR1.1 COMPILE_FAILED TEST_FAILED . . .so on this text file will get filled one by one as its for loop for n number. i... (7 Replies)
Discussion started by: RamMore123
7 Replies
realpath(3X)															      realpath(3X)

NAME
realpath - resolve pathname SYNOPSIS
DESCRIPTION
The function derives, from the pathname pointed to by file_name, an absolute pathname that names the same file, whose resolution does not involve or symbolic links. The generated pathname is stored, up to a maximum of bytes, in the buffer pointed to by resolved_name. RETURN VALUE
On successful completion, returns a pointer to the resolved name. Otherwise, returns a null pointer and sets errno to indicate the error, and the contents of the buffer pointed to by resolved_name are undefined. ERRORS
The function will fail if: Read or search permission was denied for a component of file_name. Either the file_name or resolved_name argument is a null pointer. An error occurred while reading from the file system. Too many symbolic links were encountered in resolving path. The file_name argument is longer than or a pathname component is longer than A component of file_name does not name an existing file or file_name points to an empty string. A component of the path prefix is not a directory. The function may fail if: Pathname resolution of a symbolic link produced an intermediate result whose length exceeds Insufficient storage space is available. SEE ALSO
sysconf(2), getcwd(3C), thread_safety(5), glossary(9), <stdlib.h>. CHANGE HISTORY
First released in Issue 4, Version 2. realpath(3X)
All times are GMT -4. The time now is 10:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy