Sponsored Content
Full Discussion: Create a backup utility
Top Forums Shell Programming and Scripting Create a backup utility Post 302378456 by zaxxon on Tuesday 8th of December 2009 01:54:58 AM
Old 12-08-2009
You can't use slashes in filenames since they are separators for directory structures. Example

Code:
$> ll *txt
-rw-r--r-- 1 root root 0 2009-12-08 07:50 bla1.txt
-rw-r--r-- 1 root root 0 2009-12-08 07:50 bla2.txt
$> for file in *.txt; do cp -p $file subdir/`echo $file| sed 's/\.txt//g'`_`ls -l $file| awk 'NF > 2 {print $6"_"$7}'`.txt; done
$> ll subdir
total 8
drwxr-xr-x 2 root root  4096 2009-12-08 07:53 .
drwxr-xr-x 4 isau users 4096 2009-12-08 07:50 ..
-rw-r--r-- 1 root root     0 2009-12-08 07:50 bla1_2009-12-08_07:50.txt
-rw-r--r-- 1 root root     0 2009-12-08 07:50 bla2_2009-12-08_07:50.txt

If you have filenames with blanks in them you might want to use a while loop instead of the for loop.
 

9 More Discussions You Might Find Interesting

1. Programming

Using make utility to create an mini-app

The following is my makefile. When I run "make", it gives me a bunch of error. I've compiled each file separately and there are no compilation errors. The target is "monprc". Have a look below: monprc: monprc.o monrep.o dsz.o cc -o monprc monprc.o monrep.o dsz.o monprc.o: monprc.c... (1 Reply)
Discussion started by: Yifan_Guo
1 Replies

2. Windows & DOS: Issues & Discussions

Windows XP backup utility

I am trying to use the Windows XP's backup utility (start -> all programs -> Accessories -> System Tools -> Backup) to backup the whole system to another drive or a large USB flash drive to safeguard myself and the files. However, the backup utility gives error in both cases, ie. it won't backup to... (4 Replies)
Discussion started by: milhan
4 Replies

3. UNIX for Dummies Questions & Answers

Best unix incremental backup utility?

Hello everyone. Could you please advise of what would be the best Unix (Debian 4) program for regular (daily or weekly) incremental backups? I'm not sure whether the backups will be stored on a "backup" drive on the same system or on an external "backup" system, but we would like to have a... (2 Replies)
Discussion started by: nottrobin
2 Replies

4. Shell Programming and Scripting

Find directory and create backup

What I'm attempting to do is create a script that will do a search for directories that meet the following criteria: find . -name "config" -type d this comes back with: ./dir1/anotherDir/test_dir/config ./dir1/anotherDir/test_dira/config ./dir2/test/test_dir/config The results could... (4 Replies)
Discussion started by: cbo0485
4 Replies

5. Filesystems, Disks and Memory

How to create mondo backup for size > 4.5 GB

Hello Friends, I use mondoarchive to take a bootable backup of my system on a DVD. But whenever there are large files on the system, i.e. the size of the entire backup increases beyond 4.5 GB, the mondoarchive utility does not take any backup. This is quite obvious because the size of DVD is... (1 Reply)
Discussion started by: shamik
1 Replies

6. 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

7. Shell Programming and Scripting

Create database using Backup file

Hi, I have backup file of database in my server. I want to create a that database in the same Mysql Server. How can I do that? Please send the steps to create the database using backup file? Thanks a lot, (1 Reply)
Discussion started by: aish11
1 Replies

8. SCO

Help about create backup of SCO openserver 5.0.7

hi guys im beginner in unix and have many problem with this. i have one old machine that Sco unix OpenServer 5.0.7 installed on it. i wana backup from all partition of hard disk and restore it on another unix machine. how can i do that ? thing like hard to hard for windows !!! i only know how... (14 Replies)
Discussion started by: farzad226
14 Replies

9. Solaris

How to backup (create image) SunOS 5.10 sparc?

Hello guys! I'm a newbee in Solaris systems. There is an issue, that I've got: I have to make an iso image of my solaris system. How can I do it? with dd utility? Clonezilla does not support spark, so it cant do backup. pls help! Is this solution: Creating a Solaris Flash Archive... (21 Replies)
Discussion started by: 2fat2fly
21 Replies
idevicebackup2(1)					      General Commands Manual						 idevicebackup2(1)

NAME
idevicebackup2 - Create or restore backup for iDevices running iOS4+. SYNOPSIS
idevicebackup2 [OPTIONS] CMD [CMDOPTIONS] DIRECTORY DESCRIPTION
Create or restore backup from the current or specified directory. OPTIONS
-u, --uuid UUID target specific device by its 40-digit device UUID. -d, --debug enable communication debugging. -h, --help prints usage information. COMMANDS
backup create backup for the device. restore restore last backup to the device. --system restore system files, too. --reboot reboot the system when done. --copy create a copy of backup folder before restoring. --settings restore device settings from the backup. info show details about last completed backup of device. list list files of last completed backup in CSV format. unback unpack a completed backup in DIRECTORY/_unback_/. AUTHORS
Martin Szulecki Nikias Bassen SEE ALSO
idevicebackup(1) idevicebackup2(1)
All times are GMT -4. The time now is 11:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy