request born script for creting backup files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting request born script for creting backup files
# 1  
Old 09-14-2005
request born script for creting backup files

script should make a backup sub-directory to make a backup copy of all the files that were created on a date .
The name of the subdirectory should reflect the current month and day eg BackupsAug16.

The backup files need to have extension .bak
for each file script needs to check if there already exist a backup in the sub-directory. If a backup file already exists in the sub-directory, your script needs to ask the user to replace, add or abort backup for the file.
If the respond is to replace, a new backup file need to replace the existing one
If the respond is abort, there is no need for another backup for the file
# 2  
Old 09-14-2005
thanks for sharing!
now that we know what "should" be done... what is it that you're having problems with?
# 3  
Old 09-14-2005
The phrasing makes me suspect homework anyway.
# 4  
Old 09-14-2005
Quote:
Originally Posted by Perderabo
The phrasing makes me suspect homework anyway.
or a leecher...
# 5  
Old 09-15-2005
Quote:
Originally Posted by vgersh99
thanks for sharing!
now that we know what "should" be done... what is it that you're having problems with?

i know how to create a directory and all the rest of the stuff
but i dont have an idea how to retrive all the file names individually
to make a back up file could u pleasegive me an idea
# 6  
Old 09-15-2005
look into 'man find'
# 7  
Old 09-15-2005
Quote:
Originally Posted by vgersh99
look into 'man find'
here is my code
d=backupdie`date +%d%d`
find . -name $d -type f

till here its all fine
now how do i know if the directory is found or not

now iwant to write the code where if the directory is found i need to change the permissions
if not found i need to cteate one

some thing like if else statement
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

2. AIX

Script to remove backup files

HI, I want to remove my backup files keeping last 30 days. Now i am doing it manually. Does anyone have a script to automate this process? Thanks in advance (5 Replies)
Discussion started by: ElizabethPJ
5 Replies

3. Shell Programming and Scripting

Script or alias to backup all files opened by vi

we want to backup all opened files by vi before editing also with version information. i wrote below alias to backup crontab file content with version info. What i want know is to make this opened files by vi. We want to prevent user mistakes by adding this alias. alias crontab='DATE=$(date... (4 Replies)
Discussion started by: sebu
4 Replies

4. Shell Programming and Scripting

Backup script to split and tar files

Hi Guys, I'm very new to bash scripting. Please help me on this. I'm in need of a backup script which does the ff. 1. If a file is larger than 5GB. split it and tar the file. 2. Weekly backup file to amazon s3 using s3rsync 3. If a file is unchanged it doesn't need to copy to amazon s3 ... (4 Replies)
Discussion started by: ganitolngyundre
4 Replies

5. Shell Programming and Scripting

Request for shell script for listing directories, subdirs containing specific files.

I'm looking for a script which outputs the list of directories and sub directories from root level consisting of specific files. For instance I want shell script to list all the directories and subdirectories containing .txt files.:wall: (4 Replies)
Discussion started by: super210
4 Replies

6. Shell Programming and Scripting

Script for taking backup of desktop files.

Hi Friends, I need help. I have around 100 users. I want to take date wise backup of files which are on desktop for every user. My user directory path is -: /home/dr/<user_name>/Desktop 1) Script has to run on a perticular time everyday 2) Script has to take backup of all files present... (2 Replies)
Discussion started by: paragnehete
2 Replies

7. Shell Programming and Scripting

error in sh script while copy files to a backup directory

I am trying to copy files from one directory to another using shell script. Can anyone please troubleshoot the code. thanks in advance... #!C:\Shell\sh.exe files_dir="C:\Documents and Settings\scripts\files" backup_dir="C:\Documents and Settings\scripts\ztest" echo cding to... (2 Replies)
Discussion started by: sureshcisco
2 Replies

8. Shell Programming and Scripting

script compare files and backup

Im working on a shell script that uses three parameters, a string to replace, the string replacing, and a file name. In this script it makes a back up file before the replacement occurs. However I want to be able to either search the file to see if it has the string and if it doesnt dont create... (5 Replies)
Discussion started by: gordonheimer
5 Replies

9. Shell Programming and Scripting

Script to Backup files

Hi, I wrote a simple script to backup of index.php and index.html in my box. So, I wrote a script which take a copy of the index page as 1Mar09: but it does not comes up.. #! /bin/bash find . -name index.* > domains.txt for i in `cat domains.txt` ; do cp index* index*.1Mar09 $i; done But... (6 Replies)
Discussion started by: gsiva
6 Replies

10. Programming

Creting 64-bit executable

Hi I am using solaris 8 and I need to create 64-bit executable 'lsof'. what is the cc equivalent option? and how to check whether my compiler supports 64-bit executables or not? Thanks in advance (1 Reply)
Discussion started by: axes
1 Replies
Login or Register to Ask a Question