03-30-2020
Backup files from different directories with the same name problem
Hi, I have tried multiple ways to solve this with no success, unfortunately.
I have a variable like this:
echo $var
/etc/tomcat/server.xml /etc/tomcat/test/server.xml
How can I backup both files from this variable with different names? I tried setting it as an array var2=($var) but it only shows the first file.
Thanks in advance for te help.
9 More Discussions You Might Find Interesting
1. Solaris
I know that how to backup the home directories in sun sparc server.
Firstly, umount the filesystem,
Secondly, fsck the filesystem,
Thirdly, ufsdump the filesystem.
Anybody know how to type the full command line backup the /home directory? (1 Reply)
Discussion started by: kingsan
1 Replies
2. Windows & DOS: Issues & Discussions
Hello.
I need to Backup an Directorie with Sub-directories and after that put in a log file.
Then i need to copy several files and have a log file to.
All that using old DOS. Could someone help ?
Thanks in advance (1 Reply)
Discussion started by: osramos
1 Replies
3. Shell Programming and Scripting
Hi guys,
I'm a little stuck on this problem, I've tried googling it and some trial and error but can't seem to get it working.
Basically I need the script to:
1) create a directory called "mybackups", if it doesn't exist
2) go through all the .sh files in the current directory, and copy... (4 Replies)
Discussion started by: chazij
4 Replies
4. Shell Programming and Scripting
Hello
I'm new to the area Bash scripting
and that is why I have a search script that is run on my unix server
and always when I start the server
or every 24 hours
The script will create backups of directories and subdirectories
I never found what I'm here make a new thread ... (1 Reply)
Discussion started by: HansWurst
1 Replies
5. Shell Programming and Scripting
Hey guys,
I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them.
So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk
dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
Discussion started by: boxx
5 Replies
6. Shell Programming and Scripting
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies
7. Shell Programming and Scripting
how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex.
so
mydemo--2015-03-23-1500.tar.gz
> database
-... (5 Replies)
Discussion started by: wyclef
5 Replies
8. Debian
Hi,
I'm using Kali linux, I think it's a debian linux ?
I'm trying to create a folder in which there'll be 256 folders, and in each of this folders there will also be 256 folders.
Then in each terminate folders I want to create 4096 files.
It will look like /dir/aa/aa/aaa.txt,... (3 Replies)
Discussion started by: ganon551
3 Replies
9. AIX
Hello,
Server A: /directory1/
Server B: /Backups/
i wanted to backup contents of /directory1 from "server A" on to "Server B" every 1 hour.
If there is any change in (only new/differences) contents on serverA (directory1/) supposed to be backeup on next run.
I did used rsync command to... (5 Replies)
Discussion started by: System Admin 77
5 Replies
EMPTY(3) 1 EMPTY(3)
empty - Determine whether a variable is empty
SYNOPSIS
bool empty (mixed $var)
DESCRIPTION
Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals FALSE.
empty(3) does not generate a warning if the variable does not exist.
PARAMETERS
o $var
- Variable to be checked
Note
Prior to PHP 5.5, empty(3) only supports variables; anything else will result in a parse error. In other words, the follow-
ing will not work: empty(trim($name)). Instead, use trim($name) == false.
No warning is generated if the variable does not exist. That means empty(3) is essentially the concise equivalent to !isset($var)
|| $var == false.
RETURN VALUES
Returns FALSE if $var exists and has a non-empty, non-zero value. Otherwise returns TRUE.
The following things are considered to be empty:
o "" (an empty string)
o 0 (0 as an integer)
o 0.0 (0 as a float)
o "0" (0 as a string)
o NULL
o FALSE
o array() (an empty array)
o $var; (a variable declared, but without a value)
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.5.0 | |
| | |
| | empty(3) now supports expressions, rather than |
| | only variables. |
| | |
| 5.4.0 | |
| | |
| | Checking non-numeric offsets of strings returns |
| | TRUE. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
A simple empty(3) / isset(3) comparison.
<?php
$var = 0;
// Evaluates to true because $var is empty
if (empty($var)) {
echo '$var is either 0, empty, or not set at all';
}
// Evaluates as true because $var is set
if (isset($var)) {
echo '$var is set even though it is empty';
}
?>
Example #2
empty(3) on String Offsets
PHP 5.4 changes how empty(3) behaves when passed string offsets.
<?php
$expected_array_got_string = 'somestring';
var_dump(empty($expected_array_got_string['some_key']));
var_dump(empty($expected_array_got_string[0]));
var_dump(empty($expected_array_got_string['0']));
var_dump(empty($expected_array_got_string[0.5]));
var_dump(empty($expected_array_got_string['0.5']));
var_dump(empty($expected_array_got_string['0 Mostel']));
?>
Output of the above example in PHP 5.3:
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
Output of the above example in PHP 5.4:
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
Note
When using empty(3) on inaccessible object properties, the __isset() overloading method will be called, if declared.
SEE ALSO
isset(3), __isset(), unset(3), array_key_exists(3), count(3), strlen(3), The type comparison tables.
PHP Documentation Group EMPTY(3)