Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
point-transformer
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maciej Wielgosz
point-transformer
Commits
58f93412
Commit
58f93412
authored
1 year ago
by
Maciej Wielgosz
Browse files
Options
Downloads
Patches
Plain Diff
transfer folder with files to the oracle bucket
parent
f1468350
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
oracle_scripts/send_folder_to_bucket.sh
+34
-0
34 additions, 0 deletions
oracle_scripts/send_folder_to_bucket.sh
with
34 additions
and
0 deletions
oracle_scripts/send_folder_to_bucket.sh
0 → 100644
+
34
−
0
View file @
58f93412
#!/bin/bash
# Check if both arguments are provided
if
[
"$#"
-ne
2
]
;
then
echo
"Usage:
$0
source_directory bucket_name"
exit
1
fi
# Source directory and bucket name parameters
SRC_DIR
=
$1
BUCKET_NAME
=
$2
# Function for uploading files
upload_files
()
{
local
src_path
=
$1
local
dest_path
=
$2
# Iterate over the files and directories
for
item
in
"
$src_path
"
/
*
;
do
# If it's a directory, recursively call this function
if
[
-d
"
$item
"
]
;
then
upload_files
"
$item
"
"
$dest_path
/
$(
basename
"
$item
"
)
"
else
# If it's a file, upload it to the OCI bucket
oci os object put
--bucket-name
"
$BUCKET_NAME
"
--name
"
$dest_path
/
$(
basename
"
$item
"
)
"
--file
"
$item
"
fi
done
}
# Invoke the function with root directory
upload_files
"
$SRC_DIR
"
"
$(
basename
"
$SRC_DIR
"
)
"
# sample usage
# bash oracle_scripts/send_folder_to_bucket.sh data/simple/ e2e_seg_data
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment